Hi all,
How can I create a line of code that will arrange my columns using Value Ordering? I needed the values that contains the word "new" to be on the bottom.
Original Values
F1
F2
F3
F4 - NEW
F5
F6 - NEW
F7
F8
F9 - NEW
F10 - NEW
With Value Ordering
F1
F2
F3
F5
F7
F8
F4 - NEW
F6 - NEW
F9 - NEW
F10 - NEW
This doesn't get the correct ordering as F10 will be before F4 and so on, but gives an idea what you could do (get two lists, order them, combine them and finally set property)
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(10),
Compress File When Saved(1),
New Column("A",
Character,
"Nominal",
Set Selected,
Set Values({"F1", "F2", "F3", "F4 - NEW", "F5", "F6 - NEW", "F7", "F8", "F9 - NEW", "F10 - NEW"})
)
);
l = {};
lnew = {};
For Each Row(dt,
If(Ends With(:A, "- NEW"),
Insert Into(lnew, :A);
,
Insert Into(l, :A)
);
);
final = Sort List(l) || Sort List(lnew);
Eval(EvalExpr(
Column(dt, "A") << Set Property("Value Order",
{Custom Order(Expr(final)), Common Order(0)}
);
));
