Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Pivot Table percentages based on second dimension

Hi,

I have a pivot table with two dimensions. The second dimension is placed horizontally. My expression is as follows:

=IF((Heading3) = 1,'',

IF(Divide3=1,

num(Sum({$<Description3={'Food Cost'}>}Total MonthlyActivity*Multiplier3)

/Sum({$<Description3={'Food'}>}Total MonthlyActivity*Multiplier3),'#,##0.00%;(#,##0.00)%')

,

IF(Divide3=2,

num(Sum({$<Description3={'Liquor Cost'}>}Total MonthlyActivity*Multiplier3)

/Sum({$<Description3={'Liquor'}>}Total MonthlyActivity*Multiplier3),'#,##0.00%;(#,##0.00)%')

,

IF(Divide3=3,

num(Sum({$<Description3={'Wages'}>}Total MonthlyActivity*Multiplier3)

/Sum({$<Description3={'Total Income'}>}Total MonthlyActivity*Multiplier3),'#,##0.00%;(#,##0.00)%')

,

IF(Divide3=4,

num(Sum({$<Description3={'Gross Profit'}>}Total MonthlyActivity*Multiplier3)

/Sum({$<Description3={'Total Income'}>}Total MonthlyActivity*Multiplier3),'#,##0.00%;(#,##0.00)%')

,

num((sum(MonthlyActivity)*Multiplier3)/1000,'#,##0;(#,##0)'))))))

I use TOTAL to establish correct % in the report layout. See attached images. The single dimension report works OK. (see attached) My issue is when I attempt with second dimension the % shown are for the total values than what is for the second dimension value which is placed as a column. How can I get around to achieve the correct percentages by column. i.e. (Refer Second Dimension Image) Food Cost/Income on first column should be 22/58 = 37.9% rather than showing 33.11% for all columns.

Thanks in advance

Labels (1)
0 Replies