Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
analyticsuser
Contributor
Contributor

Trying to display percentages in Trellis pie chart based on each year

Hello,

I need to display pie chart for the last five years (trellis chart) did the trick for it. However, when I am trying to calculate percentages, I am able to see data for the current year(2017). I need the percentages for all the remaining years (2013-2017). I am restricting the years in my expression. Gender is the dimension being used. Do I need to add Year as a secondary dimension in the Trellis chart?

Any help would be greatly appreciated!

Below is the expression I am using to achieve this:

num(sum(vGender)/sum(total <Year> vGender), '##.#%')

The variable vGender contains the calculation to restrict the years and the count. I am getting the correct counts, percentages in the issue.

7 Replies
sunny_talwar

What is the exact issue with the percentages? 36.5 and 63.5 are not the right percentages?

analyticsuser
Contributor
Contributor
Author

They are the correct percentages, I need to display it for 2013-2017 (shown below) but it is displaying only for 2017.

sergio0592
Specialist III
Specialist III

What is the content of variable vGender?

analyticsuser
Contributor
Contributor
Author

Hi,

I am already using Year as the first dimension but still it doesn't work. Is it because I am using Year in an expression to restrict the number of years?

sum({$<PeriodYear= {">=$(=vPriorFiveYear)<=$(=vPeriodYear)"} >}[# HeadCount])/ 12- Gives me the year range from 2013-2017 and the count of female/male

sergio0592
Specialist III
Specialist III

Is it because I am using Year in an expression to restrict the number of years?


No, with your expression you should get Year 2013 to Year 2017 in your treillis pie chart.

analyticsuser
Contributor
Contributor
Author

Any solution or ideas on how to display the percentages for all the years?

analyticsuser
Contributor
Contributor
Author

After trying several options, I am getting it like the one below. Except for 2017, rest of the years display 0% values.