Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How can I sort the column values in a specific order in the load script? For instance, I have one column with Order and another column is with Order description. Where A contains 3 descriptions, B contains 4 descriptions and C contains 5 descriptions. The fields in Order table are sorted alphabetically (A,B,C) but I want the sort order as B,C,A. Similarly, I want specific sort order for the Description table which is grouped by Order field rather than sorted default alphabetically.
I got this at the front end by applying match function in set expression.
How can I do this in the Load script?
Order | Description |
B | M |
C | |
A | |
K | |
A | Q |
G | |
B | |
C | D |
B | |
A |
Thanks!
You can use an inline load with the order and join this table. After this you can use your number to order the table.
Load * Inline
[Order, OrderNr
B,1
C,2
A,3];
Load *
resident table
order by OrderNr;
@menta : Thanks for quick reply! That worked!
It worked for the first column (Order). I also need order for the second column (Description). Currently, its sorting alphabetically in the order mentioned in the below table.
Order | Description |
B | A |
C | |
K | |
M | |
A | B |
G | |
Q | |
C | A |
B | |
D |
But I need this specific order for the description column through the load script that needs to be group by the "Order" fields. There is a unique description for each "Order". How can I get this through the load script?
Order | Description |
B | M |
C | |
A | |
K | |
A | Q |
G | |
B | |
C | D |
B | |
A |
What is the best possible way to get this? Can it be done through the set analysis? Any kind of help is appreciated!
I'm using Pivot table with the fully expanded Indent rows.