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

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 III
Contributor III
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 III
Contributor III
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 III
Contributor III
Author

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

analyticsuser
Contributor III
Contributor III
Author

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