-
1. Re: Problem with sorting on multiple dimensions
sunil.sachdeva Nov 29, 2017 2:17 PM (in response to steve.agius)Hi,
one way to do that is:
1. Drag Sales to Rows > Convert to Discrete > Multiply it with -1 > Disable Show header > Place it after Year.
something like:
Please find attached sample workbook, hope that helps.
-
Sorting.twbx 1.2 MB
-
-
2. Re: Problem with sorting on multiple dimensions
Chrysovalantis Vasilakis Nov 29, 2017 3:08 PM (in response to sunil.sachdeva)Hi Steve,
You can solve this by using Rank (Rank Calculation). Just make sure that your table calculation is computed Pane Down!
I created an example using Rank Sum(Sales). Please see the below pic and the attached Tableau Packaged Workbook.
I hope it is answering your question.Best regards,
-
Top N with Rank.twbx 510.9 KB
-
-
3. Re: Problem with sorting on multiple dimensions
steve.agius Nov 30, 2017 1:33 PM (in response to sunil.sachdeva)Dear Sunil,
Many thanks for the tip. I have created the measure as indicated by your goodself, however I cannot move the measure. I am attaching the file.
Would appreciate your help.
Thanks,
Steve-
question 8.twbx 1.2 MB
-
-
4. Re: Problem with sorting on multiple dimensions
sunil.sachdeva Nov 30, 2017 2:14 PM (in response to steve.agius)-
question 8.twbx 1.2 MB
-
-
5. Re: Problem with sorting on multiple dimensions
steve.agius Nov 30, 2017 2:49 PM (in response to sunil.sachdeva)Perfect - that works! :-) however, it seems that I have a problem in my view. I need to create the top 5 products, somehow its not picking the top 5 in descending order. any help appreciated.
-
6. Re: Problem with sorting on multiple dimensions
sunil.sachdeva Nov 30, 2017 3:16 PM (in response to steve.agius)Hi Steve,
there are various ways to calculated Top N, i used Rank(), please find below steps:
1. Create a flag for Top N customers using RANK()
2. Drag it to Filters:
3. Right click and edit table calculations:
4. Edit filter and select only True Values:
5. You would get result as Top5 by State by Year:
Please find attached sample workbook.
Hope that helps.
-
question 8.twbx 1.3 MB
-
-
7. Re: Problem with sorting on multiple dimensions
Chrysovalantis Vasilakis Nov 30, 2017 3:21 PM (in response to steve.agius)Hi sunil.sachdeva and steve.agius,
The solution you are looking for can be achieved with either a Rank table calculation or a combined field. The benefit of the Rank is that you can give the user the option of top N filtering. This is how you would be taught during an official Tableau course to solve a nested sorting problem.
Andy Kriebel has captured all the necessary steps in a video and provides an example with both techniques in the following link: Tableau Tip Tuesday: Two Techniques for Nested Sorting
Please let me know if I am understanding anything wrongly regarding your question.
Best regards,
Valantis
-
8. Re: Problem with sorting on multiple dimensions
sunil.sachdeva Nov 30, 2017 3:30 PM (in response to Chrysovalantis Vasilakis)Thanks Valantis,
I agree with you, i shared using discrete measure tip because TOPN was not mentioned in question (or i misread it ).
however i agree RANK() is better way to calculate TOP N Filtering or TOPN Sorting,
cheers.