Here is one possible solution using Matrices. If no information about column name is needed, it can be made shorter by removing result_column and calculations related to it.
Names Default To Here(1);
dt = Current Data Table();
result_flag = [];
result_column = {};
For Each Row(dt,
m_all = dt[Row(), 0]; //get all values of row to matrix
m_values = m_all[Loc(m_all)]; //remove missing values;
start = Insert(m_values[1::N Items(m_values)-1], 0, 1); //shift right by 0 and remove last value
end = m_values;
//if we only want to know if any value is smaller than previous, we can just us any
Insert Into(result_flag, Any(end - start < 0)); //we could stop here if we don't want to know the column name
//but that doesn't tell us which column(s) breaks the "rule"
idx = Loc(end - start < 0); //indices of value matrix which break the rule -> will require checking for empty
If(N Items(idx) == 0,
Insert Into(result_column, "");
, //else
breaking_col = Min(Loc(m_all, m_values[Min(idx)])); //values which break rule, we can most likely just get the first index?
Insert Into(result_column, Column(dt, breaking_col) << get name);
);
);
dt << New Column("Flag", Numeric, Nominal, Values(result_flag));
dt << New Column("Column_Flag", Character, Nominal, Values(result_column));
Could most likely be also used as a formula, but wouldn't most likely recommend as it is fairly easy to break:
dt << New Column("Formula_Flag", Numeric, Nominal, Formula(
dt = Current Data Table();
m_all = Matrix(dt[Row(), 0]);
m_values = m_all[Loc(m_all)];
start = Insert(m_values[Index(1, N Items(m_values) - 1)], 0, 1);
end = m_values;
Any(end - start < 0);
));
-Jarmo