Greetings, ALLteryx fellows!
I have to change the order of columns of a list of products given their grand totals descending order...
I'll use here a 4 products list example, but my real problem has 88 products so I cannot afford to rearrange columns order manually... This list can even be bigger in the future...
For instance, if after summing up their values I do get:
| Sum_A Product | Sum_B Product | Sum_C Product | Sum_D Product |
| 316 | 122 | 4087 | 88 |
Using the Transpose tool I can transpose this 2x4 table into a 4x2 table:
| Sum_A Product | 316 |
| Sum_B Product | 122 |
| Sum_C Product | 4087 |
| Sum_D Product | 88 |
Then I sort the numbers' column in descending order using the Sorting tool:
| Sum_C Product | 4087 |
| Sum_A Product | 316 |
| Sum_B Product | 122 |
| Sum_D Product | 88 |
Then I use the Multi-line Formula tool just to wipe out the "Sum_" prefix of variables.
| C Product | 4087 |
| A Product | 316 |
| B Product | 122 |
| D Product | 88 |
Nice and easy so far...
Ok, time to transpose back... I found out this to be easier to be done with the Cross Tab tool.
HOWEVER, as I do so, it reorders columns by its alphabetical order, not the totals' order I have just sorted...
I get...
| A Product | B Product | C Product | D Product |
| 316 | 122 | 4087 | 88 |
...instead of getting this:
| C Product | A Product | B Product | D Product |
| 4087 | 316 | 122 | 88 |
What am I doing wrong?
I know, there probably is a solution whose simplicity can be annoying, but I simply was unable to find it.
Can you please help me finding it?
Attached is the flow which I just described above...
Thanks in advance!