Help with Value OrderingSo 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=""></SET>
I also tried the following after value ordering but it doesn't help
dt << Sort(By(:Results),Order(Ascending),Replace Table);
Re: Help with Value OrderingHi @Thierry_S
I tried your script but still the column order is alphabetical
Re: Help with Value OrderingHi Shah,
I believe that the latest script I uploaded in my previous message performs the way you want. Have you tried it?
Best,
TSRe: Help with Value Ordering@Thierry_S
Lets say the user input the following for sample names in the text edit box:
C for b1
B for b2
A for b3
then the column order becomes "Buffer", b3, b2, b1 when I run the script, it follows an alphabetical order. I want the script to run so that the column order remains "Buffer", b1, b2, b3 no matter what is input as sample names.
Re: Help with Value OrderingHi,
I'm still not clear what you are trying to do but the following slightly modified script does not return any error in the Log (see the Eval List call at the bottom)
Names Default to Here (1);
dt = current data table();
InputWindow = New Window( "Enter Input",
<<MODAL></MODAL>
Re: Help with Value Ordering@Thierry_S @ron_horne
Sorry for some of the confusion, this is the more extended version of my script
dt = current data table();
InputWindow = New Window( "Enter Input",
<<MODAL></MODAL>
Re: Help with Value OrderingNever mind, I got it now
Best,
TSRe: Help with Value OrderingHi Shah,
Sorry that my short script did not do the job. I'm trying to figure out what you mean by "user inputs captured by b1, b2"? Are these numerical values or other labels for the specific assay condition?
Best,
TSRe: Help with Value OrderingHi @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} ) );Re: Help with Value OrderingHi @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.
Re: Help with Value OrderingHi 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 ) );Re: Help with Value OrderingHi @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.
Re: Help with Value OrderingHן @shah47
can you upload a table with just that column?
Re: Help with Value OrderingThanks all for the prompt reply, unfortunately it still reverts the column order by alphabetical
Re: Help with Value OrderingI am not sure but try this:
:Results << Set Property( "Value Ordering", Eval List( {"Buffer", b1, b2, b3} ) );Re: Help with Value OrderingHi @shah47
try the following:
dt <SPAN class="token operator">=</SPAN> <SPAN class="token function">current data table</SPAN><SPAN class="token punctuation">(</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
<SPAN class="token punctuation">:</SPAN>Results<SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token messages">set property</SPAN><SPAN class="token punctuation">(</SPAN><SPAN class="token string">"value ordering"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token punctuation">{</SPAN><SPAN class="token string">"Buffer"</SPAN><SPAN class="token punctuation">,</SPAN> "b1"<SPAN class="token punctuation">,</SPAN> "b2"<SPAN class="token punctuation">,</SPAN> "b3"<SPAN class="token punctuation">}</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
once this is correct, the sorting should work as well,
ron