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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mohamed_ahid
Partner - Specialist
Partner - Specialist

Sub total issue

Hi every body,

I'm working on a pivot table like this :

LevelCanalCost this yearCost last yearWeignt
RENAGELHP48655641,6546.22%
MT35065641,6533.31%
GP21541927,820;46%
Total 105251927,8100%

for facts columns i used this formulas :

Cost this year : set analysis over Cost column using a varibles which returns this year number :

 

=sum({<Level={'level1'},Year={$(=year_n)}>}cost) 

Cost last year : same thing this the formula :

=sum({<Level={'level1'},Year={$(=year_n-1)}>}cost)

my question is what is the formula to calculate weight like in the  table ? 

exmple : 46.22%=(4865/10525)*100

THX

10 Replies
stevelord
Specialist
Specialist

I see assumed answered, but had one more neat trick to contribute.

Just make another column with the same expression, then check the 'relative' box and set totals mode to 'expression totals' for that expression.  (These options are on the expressions tab.).  That's if you want one column for the counts and one for the percentages.  You could just check the relative box on the expression you have to make it go to percentages.