Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
dan205
Contributor III
Contributor III

Help with Pie Chart

I have a Dimension with values A to Z, let's call it Alphabet, and Measure called Sales.
I want to compare the sum of Sales for two groups of Alphabet, and visualise it with a pie chart.

If I wanted to create two separate KPIs, I would use these expressions:

Sum({<Alphabet={'A','B'}>} Sales)

Sum({<Alphabet={'B','C','D'}>} Sales)

But how do I write an expression for the pie chart to show those two totals?

Something like this mock-up:

excel pie chart.png

Thanks in advance,

Dan

Labels (4)
1 Solution

Accepted Solutions
MatheusC
Specialist
Specialist

Hi, @dan205 
one solution I see would be for you to be working with ValueList,

ex:

dimension: ValueList('GrupoAB','GrupoBCD')

measure
if(ValueList('GrupoAB','GrupoBCD')='GrupoAB',
Sum({<Alphabet={'A','B'}>} Sales)
,
if(ValueList('GrupoAB','GrupoBCD')='GrupoBCD',
Sum({<Alphabet={'B','C','D'}>} Sales)
))

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!

View solution in original post

2 Replies
MatheusC
Specialist
Specialist

Hi, @dan205 
one solution I see would be for you to be working with ValueList,

ex:

dimension: ValueList('GrupoAB','GrupoBCD')

measure
if(ValueList('GrupoAB','GrupoBCD')='GrupoAB',
Sum({<Alphabet={'A','B'}>} Sales)
,
if(ValueList('GrupoAB','GrupoBCD')='GrupoBCD',
Sum({<Alphabet={'B','C','D'}>} Sales)
))

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
dan205
Contributor III
Contributor III
Author

Perfect, thank you.