cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

Using SortByColumn in a TableBox

AdditiveRange10
Level II

Hello All,

I have a TableBox generated from a process screening script. I would like to use two column to sort by sequentially.

Firstly, the col "Column" and then "xDrawingNumber". If I do this manually on the TableBox the output looks correctly, however scripting it I am unable to figure it out. I use the SortByColumn in the SendToReport option but not combination of groupings or commands have given me the right answer.

Any suggestion would be greatly appreciated.

AdditiveRange10_0-1734034070518.png

SendToReport( Dispatch( {}, "", TableBox, {SortByColumn( "Column",1)}))

 



3 REPLIES 3
jthi
Super User


Re: Using SortByColumn in a TableBox

Check Table Box from scripting index and look for Sort

jthi_0-1734041882220.png

 

You might be able to do some simple "multi-column" sorts by sorting multiple times in correct order

 

View more...
Names Default To Here(1);
New Window("Mountains",
	tb = Table Box(
		Number Col Box("R", {1,1,2,2}),
		String Col Box("Mountain",
			{"K2", "Delphi", "Kilimanjaro", "Grand Teton"}
		),
		Number Col Box("Elevation (meters)",
			{8611, 681, 5895, 4199}
		),
		Plot Col Box("", {8611, 681, 5895, 4199})
	)
);
tb << Sort By Column(3, 1);
tb << Sort By Column(1, 1);

 

 

-Jarmo


Re: Using SortByColumn in a TableBox

Thanks. That seems to be working for a standalone tablebox which is part of what I am trying to do.

Sadly, I also want to perform a similar two column sequential sort on the Process Screening platform directly which seems stubborn as well. In this case, I cannot work with the tablebox directly and that is why I was using the SendToReport command.


Re: Using SortByColumn in a TableBox

I think I found a solution. I removed any sorts from the Process Screening platform directly and then just use the Dispatch command with SortByColumn twice sequentially on the Process Screening variable. The sorting now looks as expected.