Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear,
At the moment I am trying to make a bar chart with as group year-month and as bar a certain categoy.
As measure I'd like to have percentages of the group (year-month). Say I have in a certain year-month 100 people in total of which 25 in category 1 and 75 in category 2. I get the right percentages in a table, but when I try to calculate it in the barchart using the aggr function I get only one of both percentages. When I add the total hardcoded I get both.
How can I make sure both percentages are shown in the bargraph?
Below what I am using at the moment but does not show the correct results.
Sum({<
>} [Measure])
/
Sum(
Aggr(
Sum({<
>} Measure])
, [year-month]))
Many thanks for helping me out.
Try this :
Sum(Measure])
/
Sum(Aggr(NODISTINCT
Sum({<Category =>} Measure])
, [year-month]))
Kind regards,
Théo ATRAGIE.
Dear Theo,
Thanks so much! Thanks to your input with one small change the barchart shows the correct results!
Sum(Measure])
/
Only(Aggr(NODISTINCT
Sum({<Category =>} Measure])
, [year-month]))
Kind regards!
Can you put a visual example of what you're expecting? (The table for example).
Kind regards,
Théo ATRAGIE
Hi Theo,
Thank you for your reply. Below an example of the table with the percentages. Below it an example of the barchart, however with counts not %. When I try to show them as percentages of the total of the group (say 24-02 for instance) I get just one of both percentages.
Year-Month | Total | Category 1 | Category 2 | Category 1 | Category 2 |
24-01 | 7.816 | 2113,729713 | 5701,821626 | 27,0% | 73,0% |
24-02 | 3.777 | 1418,119653 | 2358,904591 | 37,5% | 62,5% |
Kind regards!
I try to do this in 20 minutes.
Try this :
Sum(Measure])
/
Sum(Aggr(NODISTINCT
Sum({<Category =>} Measure])
, [year-month]))
Kind regards,
Théo ATRAGIE.
Dear Theo,
Thanks so much! Thanks to your input with one small change the barchart shows the correct results!
Sum(Measure])
/
Only(Aggr(NODISTINCT
Sum({<Category =>} Measure])
, [year-month]))
Kind regards!