Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dimensions in Pie Chart

Hello.

I have a pie chart in QV 10 where I would like to show the information about the percent of sales in one Year comparing to the Year before and with the next Year, meaning I would have something like:

Year Selected: 2011

The pie chart would 3 slices with something like:

2010 - 25%

2011 - 34%

2012 - 41%

Is this possible? How can I achieve this?

Thanks in advance

Labels (1)
1 Solution

Accepted Solutions
johnw
Champion III
Champion III

If your year is a 4-digit number, I believe this:

Dimension  = if(Year>=$(=max(Year)-1) and Year<=$(=max(Year)+1),Year)
Expression = sum({<Year=,Month=,etc. for all calendar fields>} Sales)
checkmark "values on data points" on expressions tab
checkmark "relative" on expressions tab

If your year is a date formatted as YYYY (which is what I usually do):

Dimension  = if(Year>=$(=addmonths(max(Year),-12)) and Year<=$(=addmonths(max(Year),12)),Year)

View solution in original post

3 Replies
Not applicable
Author

In addition, I have a report with that pie chart but I can't get it to print the % next to the slices as I can see in the screen... is that possible as well?

Thanks

johnw
Champion III
Champion III

If your year is a 4-digit number, I believe this:

Dimension  = if(Year>=$(=max(Year)-1) and Year<=$(=max(Year)+1),Year)
Expression = sum({<Year=,Month=,etc. for all calendar fields>} Sales)
checkmark "values on data points" on expressions tab
checkmark "relative" on expressions tab

If your year is a date formatted as YYYY (which is what I usually do):

Dimension  = if(Year>=$(=addmonths(max(Year),-12)) and Year<=$(=addmonths(max(Year),12)),Year)

Not applicable
Author

I've done it now!

I hadn't my Expression fine so it didn't work as I expected but it was a mistake of mine so thank you very much John, I've done the pie chart now.

I still got the "error" in the report. When I create/edit the report, the % appear in the chart but if I do "Print Preview" they don't appear :s