Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Below is my data. I want to insert a Stacked Bar chart which Displays "Learning Plan" and "No Learning Plan" as percentages.
My Dimension is LOB.
I am struggling with the expression, could you please help me with this?
LOB | Population | Learning Plan | No Learning Plan |
---|---|---|---|
LOB1 | 2500 | 2000 | 500 |
LOB2 | 3000 | 2000 | 1000 |
LOB3 | 3500 | 2500 | 1000 |
LOB4 | 2500 | 1000 | 1500 |
Regards,
Varun.M
Only() is an aggregation function and shouldn't be used around another aggregation:
Try like this
Learning Plan %:
=Sum([Learning Plan]) / Count([Standard Id])
No Learning Plan %:
= 1 - Sum([Learning Plan]) / Count([Standard Id])
use bar chart style 'stacked' and format as percent on number tab.
Maybe like this:
Use LOB as dimension, and two expressions:
=Only([Learning Plan]) / Only([Population])
=Only([No Learning Plan]) / Only([Population])
Set style of the bar chart to stacked. Select 'Show in percent' on number tab for both expressions.
Hi Stefan,
Thanks for your reply. "Population" and " No Learning Plan" are calculated columns.
Population = Count(StandardID),
No Learning Plan = [Population]-[Learning Plans]
so when I use the above formula.I get an error message! Any other workaround this?
Regards,
Varun.M
Just replace Only(FIELDNAME) with your expressions.
Where you reference another expression and you don't want to use it in your chart, expand the Expression reference to the full expression text.
Not sure how you calculate Learning Plans, but No Learning plan would look like
=Count(StandardID) - WhateverAggregationUsedForLearningPlan
Expression for LearningPlan = sum(LearningPlan).
As advised above, I get " Error in Expression : ')' expected"
Learning Plan = only(sum([Learning Plan])/only(count([Standard Id]))
No Learning Plan = only(Count([Standard Id]-only(sum([Learning Plan]))
Not sure where I am going wrong! Kindly assist.
Only() is an aggregation function and shouldn't be used around another aggregation:
Try like this
Learning Plan %:
=Sum([Learning Plan]) / Count([Standard Id])
No Learning Plan %:
= 1 - Sum([Learning Plan]) / Count([Standard Id])
use bar chart style 'stacked' and format as percent on number tab.
Thank you sooo much! This helps.