Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Master II
Master II

Re: calculating percentages per dimension

use this as expression:

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

View solution in original post

Highlighted
Contributor III
Contributor III

Re: calculating percentages per dimension

Try this,

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

View solution in original post

4 Replies
Highlighted
Master II
Master II

Re: calculating percentages per dimension

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;
Highlighted
Contributor II
Contributor II

Re: calculating percentages per dimension

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!

Highlighted
Master II
Master II

Re: calculating percentages per dimension

use this as expression:

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

View solution in original post

Highlighted
Contributor III
Contributor III

Re: calculating percentages per dimension

Try this,

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

View solution in original post