So I want to order my column a certain way by using the Value ordering property. In this case b1, b2 and b3 are user inputs from Text Edit Box but still the ordering in the column does not follow {"Buffer", b1, b2, b3} it follows an alphabetical order.
dt = current data table();
:Results<<set property("value ordering", {"Buffer", b1, b2, b3});I also tried the following after value ordering but it doesn't help
dt << Sort(By(:Results),Order(Ascending),Replace Table);
Hi @shah47
try the following:
dt = current data table();
:Results<<set property("value ordering", {"Buffer", "b1", "b2", "b3"});
once this is correct, the sorting should work as well,
ron
I am not sure but try this:
:Results << Set Property( "Value Ordering", Eval List( {"Buffer", b1, b2, b3} ) );
Thanks all for the prompt reply, unfortunately it still reverts the column order by alphabetical
Hi @ron_horne
I have attached the column, just to recap, the user inputs are captured as b1, b2, etc. In this instance I did a test and inputed "B" for b1 and "A" for b2 but as you can see the order in the table comes out as alphabetical.
Hi Based on the table you shared,
Here is a short script that should do what you want: just change the order of the values in the Set property call
Names Default to Here (1);
dt = Current Data Table ();
:Results << set property("value ordering", {"Blank Sample Well", "Running Buffe", "Buffer", "A", "B"});
dt << Sort( replace table, By( :Results ), Order( Ascending ) );
Hi @Thierry_S
Thanks but that solution will not work for what I'm trying to do. "A" and "B" are user inputs captured by b1, b2, etc with a Text Edit Box. So after the user inputs the values for b1, b2, the column order defaults to alphabetical.
Hi @shah47
I think @Mark_Bailey got it right.
Pleas open the attached file and see if the scripts do the job.
names default to here (1);
a = "Running Buffe"
b1 = "B";
b2 = "A";
b3 = "Blank Sample in well";
b4 = "Buffer";
:Results << Set Property( "Value Ordering", Eval List( {a, b1, b2, b3, b4} ) );