Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
NormanStanleyBadger

Show value as % of the total per period

Hi,

I have a table that splits out sales per quarter by dimension, as per below. 

Dimension 2023 Q1 2022 Q4 2022 Q3
Total 750 1000 1250
D1 250 500

1000

D2 500 500 250

 

I would like to show the values as a percentage of their respective quarterly total, as per below.

Dimension 2023 Q1 2022 Q4 2022 Q3
Total 100% 100% 100%
D1 33.3% 50% 80%
D2 66.7% 50% 20%

 

Thanks

Labels (5)
5 Replies
BrunPierre
Partner - Master
Partner - Master

=Num(Sum(Sales) / Sum(Total Sales), '##.0%'))

NormanStanleyBadger
Author

Hi, thanks for the reply, I have tried this but I am getting the total for the entire period selected in my set analysis about 3 years worth rather than than the individual total per quarter?

BrunPierre
Partner - Master
Partner - Master

Post your initial expression.

NormanStanleyBadger
Author

Sum(
{$
<
Set Analysis
>}
[Sale Result Count])

/

Sum({$
<
Set Analysis
>}
			
Total [Sale Result Count])
NormanStanleyBadger
Author

Hi, I managed to solve this with more digging around. The Total keyword also has a qualifier distinct from set analysis which you can use to ask it to only apply the Total to certain dimensions. So in this case it would be:

 

Sum ( {<Set Analysis>} [Sales]) / Sum ( Total <[YearQuarter> {<Set Analysis>} [Sales])