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: 
BoXiangWang
Contributor III
Contributor III

How to calculate subtotal in a straight table

Hi all,

I knew it should be an old topic, but after browsing some articles it is still not clear to me how to calculate the subtotals in a chart.

In my case as below, I want to let the Denominator become the sum of gender "F" and "M" of each month so that I can use it to calculate the percentage of females and males of each month.

BoXiangWang_0-1710225906409.png

 

For instance, the first row should be 53 / (53+12) since I want to have the percentage of females in Jan.

However, I don't know how to use set analysis with Total. Is there any references of ideas allowing me to achieve it without changing my data model? Thanks!

Numerator: =$(=v_ppl_count)

v_ppl_count: count(distinct Amount)

Labels (1)
1 Solution

Accepted Solutions
Rohan
Partner - Specialist
Partner - Specialist

Try this.

v_ppl_count: count(Total<Month> distinct Amount)

 

Regards,

Rohan.

View solution in original post

2 Replies
Rohan
Partner - Specialist
Partner - Specialist

Try this.

v_ppl_count: count(Total<Month> distinct Amount)

 

Regards,

Rohan.

BoXiangWang
Contributor III
Contributor III
Author

Thanks, it's what I need!