2 Replies Latest reply on Dec 14, 2016 7:16 AM by Nick Corbin

    Top N, Percent of Total and Filters

    Nick Corbin

      Hi, I have a viz with a table subject to a number of filters. I'm trying to show a top N of count of account numbers with a percent total calculation of the filtered set (not just of the total shown after the filter or filters have been applied).

       

      I thought I could achieve this using context filters, setting a top N in the context filter(s) and a table calculation but I haven't been able to get it to work.

       

      If I use a straight '% of Total' quick table calculation the % returned changes to reflect the total shown as the top N is changed, i.e. the 2nd column in the below where top N = 5 and then top N = 8.

       

       

      To solve this I thought using a fixed LOD calc would work given the order of operations in Tableau however it doesn't. I've used COUNT([Account No]) / SUM({COUNT([Account No])}) in the 3rd columns and this returns the same % figures as the top N is changed which is good; the issue is that the denominator is always more than it should be, i.e. in the below a context filter has been applied with all values shown so the denominator should return 521,760 to give 100% but it doesn't.

       

       

      Any help would be much appreciated.

       

      Thanks,

       

      Nick