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: 
Anonymous
Not applicable

Problems with Pie Charts

Hello, I'm a new user in qlikview, so I'm eager to know if you can help me out.

I'm trying to do a pie chart with different values.These values represent the sales of every single product that I have over a year.
There are many years which I can choose to make a query.

For example:

Year    product1  product2    product3   product4

2010     30           40                    20               10

2011     30           20                    35                15

2012     25          10                     5                   5

The problem that I'm having, is that when i do the chart, I'm not really sure how to define the expression. So far I have used "sum" because it's the only way that I can see the sales of the 4 productos on the chart, but the number that is represented in the chart is the sum of every product throughout the years, leaving me the chart with these values:

Product1: 85

product2: 70

Product3: 60

Prodcut4: 30

This is the expression that I used:

=sum(Sales_Product1)

=sum(Sales_Product2)

=sum(Sales_Prodcut3)

=sum(Sales_Product4)

How can i do the chart so that only appears the value of the single year that I have selected??

I would be very grateful for the help that you could lend me

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

1. Add a listbox for the year field and select a year. Your expressions will automatically reflect your selections.

2. Modify the expression and hard code a year: =sum({<Year={2010}>}Sales_Product1)

3. Modify the expression to use a variable, e.g. vYear, and use a slider or input box to set the value of the variable: =sum({<Year={$(vYear)}>}Sales_Product1)


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

1. Add a listbox for the year field and select a year. Your expressions will automatically reflect your selections.

2. Modify the expression and hard code a year: =sum({<Year={2010}>}Sales_Product1)

3. Modify the expression to use a variable, e.g. vYear, and use a slider or input box to set the value of the variable: =sum({<Year={$(vYear)}>}Sales_Product1)


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Still with the same problem...

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Then I don't understand your problem. Please post a document that demonstrates the problem.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

I made a mistake with the code, your answer did help me.

Thank you very much!