Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to sort a table where regardless of the total, when Category is 'Other' then it should be at bottom of the table. The other values should be sorted by total.
Sort-> Sum(Units):
Category | Units | Sort |
Notebooks | 400 | 400 |
Tablets | 300 | 300 |
Other | 200 | 200 |
Desktops | 100 | 100 |
Sort-> Sum(Units)*if(Category='Other',-1,1) :
Category | Units | Sort |
Notebooks | 400 | 400 |
Tablets | 300 | 300 |
Desktops | 100 | 100 |
Other | 200 | -200 |
So far so good. Now, the problem is that is some cases the total values are negative which put Other at the top (-200*-1=200) and not bottom.
Category | Units | Sort |
Other | -200 | 200 |
Desktops | -100 | -100 |
Tablets | -300 | -300 |
Notebooks | -400 | -400 |
What would be a possible sort expression that suits both scenarios?
Please take a look at the sample I have attached. I am not using the flag in the calculation at all. I'm only using it as a dimension for sorting.
Thanks mphekin12,
That works but not applicable in my situation because my object is pivot table, meaning I cannot hide the dimension.