Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
frederikverhaeghe
Contributor II
Contributor II

calculating percentages per dimension

I had a question with respect to this point: 

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/ChartFunctions/...

In the example given, there are two dimensions, namely year and quarter. The sum for 2012 is 6000, and for 2013 is 4800. 

How can I make a table with year | quarter | sum per quarter | % in quarter with respect to year ?

This would then look like: 

YearQuarterAmount% in quarter
2012Q1110018%
2012Q2170028%
2012Q3140023%
2012Q4180030%
2013Q1100021%
2013Q2130027%
2013Q3110023%
2013Q4140029%
2 Solutions

Accepted Solutions
Frank_Hartmann
Master II
Master II

use this as expression:

sum(Amount)/sum(Total<Year>Amount)

View solution in original post

IamAlbinAntony
Creator
Creator

Try this,

sum(Amount)/sum(total <Year>Amount)

View solution in original post

4 Replies
Frank_Hartmann
Master II
Master II

1:
LOAD Year, 
     Quarter, 
     Amount
FROM
[https://community.qlik.com/t5/New-to-Qlik-Sense/calculating-percentages-per-dimension/td-p/1699310]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);

left join

load

Year, sum(Amount) as Sum  Resident 1 Group by Year;

NoConcatenate

Finale:
load *, Amount/Sum as Ratio Resident 1; DROP Table 1;
frederikverhaeghe
Contributor II
Contributor II
Author

Hello Frank,

Thanks a lot for your swift suggestion. 

Unfortunately, I cannot access the load script (Enterprise version with limited access rights). 

Is there a way to achieve the same result in charts/tables directly?

Thanks again!

Frank_Hartmann
Master II
Master II

use this as expression:

sum(Amount)/sum(Total<Year>Amount)
IamAlbinAntony
Creator
Creator

Try this,

sum(Amount)/sum(total <Year>Amount)