4 Replies Latest reply: Jul 23, 2017 9:24 AM by Mrutyunjaya Hiremath RSS

    Qlik Sense Pivot table - Calculating percentages

    Mrutyunjaya Hiremath

      Hi,

       

      I am trying to convert Values in a Pivot table into Percentages. 


      The expression used to get the counts / values is:

      >     Count(distinct ID)

       

      I tried using the below formula to get the percentages, but the effort is in vain.

      >    Count(distinct ID) / Count( total distinct ID)

      >    Count(distinct ID) / Count({$<Date1>}  total distinct ID))

      >    Count(distinct ID) / Count({$<Date2>}  total distinct ID))

      >    Count(distinct ID) / Count({$<Date1>}  distinct ID))

      >    Count(distinct ID) / Count({$<Date1>} distinct ID))


      The sample data appears like this:

      Table 1:

      Date2
      Date12016May2016Jun2016Jul2016Aug
      Totals1570200330560380
      2016May56020015090120
      2016Jun430-18022030
      2016Jul330--25080
      2016Aug250---150

       

       

      Table 2: Required

      Date2
      Date12016May2016Jun2016Jul2016Aug
      Totals1570
      2016May56036%27%16%21%
      2016Jun430-42%51%7%
      2016Jul330--76%24%
      2016Aug250---60%

       

      Kindly suggest the appropriate method to get the results.

       

      Regards,

      Mrutyunjaya