Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone !
I have a pie chart with the number of men and the number of women, but I'd like to add the percentage on each section of the part chart. How can I do that ??
This can be a bit more tricky...
you can use a dual expression:
dual( sum(number) & chr(10) &
num( sum(number)/sum(total number), '##%')
, sum(number))
You can check my attachment.
Hope this helps,
Erich
hi,
go to properties->Expressions
click on Relative, click on "Text on Data Point".
that should do the trick.
On the chart properties -> Expressions tab, you can select your expression and check the box 'Relative'
or your expression could calculate the % of a value directly, with something similar to this:
sum( Value) / sum( total Value)
where Sum( Total Value) will automatically be the Sum( Value) of all the possible values of your dimensions.
Hope this helps,
Erich
It works but it indicated only the percentage. Can I have both, number and percentage ?
This can be a bit more tricky...
you can use a dual expression:
dual( sum(number) & chr(10) &
num( sum(number)/sum(total number), '##%')
, sum(number))
You can check my attachment.
Hope this helps,
Erich
Just a last one little question, I have my customer field which is M or F. What should I writte for count only the M or only the F ? (something like count(customer) where customer=F)
thank you for your help
In that case, you can use set analysis.
count ( { <customer = {F}> } customer)
if the value you need has spaces you can use single quotes
count ( { <FIELD = {'A B'}> } customer)
you can use comma to filter more than one value:
count ( { <customer = {'F', 'A B'}> } customer) (for customer = 'F' or customer = 'A B'
Regards,
Erich
Thank you very much 😃
Tried the dual solution but never got it working, was trying to present both sales amount and % of sales for several customers, so was working with more than 2 alternatives...also other limitations like timing and so on.
Found a much easier solution, simply copied the expression (sum of sales for period x, customer in dimension) so I had 2 identical, and made one of them "relative"...since the proportions are exactly the same, it worked like a charm. getting both sales figure and % of sales.
Not perfect when zooming in to the small slices as the % is the percentages of % shown (maybe this was an issue with the dual solution as well?), but the overall picture works.