Announcements
cancel
Showing results for
Did you mean:
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:

Dan

Labels (4)

• ### Visualization

1 Solution

Accepted Solutions
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!
2 Replies
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!
Contributor III
Author

Perfect, thank you.

Tags