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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using multiple fields in a pie chart


Hello everyone,

I am trying to create a pie chart that shows the sum of each Generation by Area:

Generation.JPG

I need to creat a pie chart for each Area, so the first one will display the values of Baby Boomers, X and Y for "IT" and so go on.

I have created "Area" as the Dimension, and included 3 expressions:

sum ({<[Area]={IT}>}[Baby Boomers])

sum ({<[Area]={IT}>}X)

sum ({<[Area]={IT}>}Y)

And thats the result i had:

IT.JPG

How can i show the values of each Generation in the same pie chart??

Thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Remove the dimension.

View solution in original post

9 Replies
swuehl
MVP
MVP

Remove the dimension.

Not applicable
Author

I don´t believe it was only that. (lol)

Thanks swuehl

swuehl
MVP
MVP

Alternatively, load your data like

CROSSTABLE ( Generation, Value,2)

LOAD Area, Year, [Baby Boomers], X, Y

FROM ...;

Then create a pie chart (if you want...) with two dimensions, Area and Generation, select Trellis option for first dimension.

Use a single expression:

=Sum( Value)

Not applicable
Author

Hi swuehl,

Please, could you clarify why you included "Value" and "2" into the Crosstable parameters?

CROSSTABLE ( Generation, Value,2)

Thanks

swuehl
MVP
MVP

"Value" is the name of the field that will be generated by the transformation to hold the values (i.e. the number currently contained in fields Baby Boomers, X, Y). "Generation" will be the field that holds the generation values: "Baby Boomers", "X", "Y"). "2" is telling QV to handle first two fields in the LOAD statement as qualifying fields.

See also the HELP and

The Crosstable Load

Not applicable
Author

Hi swuehl,

Thanks a lot for your help.

It worked fine, but now i have other problem:

As you can see the data table above, there is a field Year, where i created a list to filter the results by Year.

I am using a single expression now:

sum({<[Area]={[Farma Brazil*]}>}Value)

With this expression in the pie chart, the list of the year is no filtering the results.

Do you know if it is possible to fix that?

Thanks

swuehl
MVP
MVP

Yes, should be possible. But it's unclear how your current model looks like and what's causing the issue.

Could you upload a small sample QVW?

Not applicable
Author

I have found where it was the issue.

I remaned the fields in the CrossTable, when i changed to the same name of the original fields the chart is filtering the results by year.

Thanks again swuehl.

Not applicable
Author

Bot now i have synthetic keys as i have two tables with the same fields name.