
Re: Pie chart, count scores  lower, middle, upper
Stefan Wühl Sep 24, 2017 4:33 AM (in response to Kristan Sears)Try a calculated dimension like
=Aggr(
If( Sum(Attained)/Sum(Possible) < 0.5, dual('< 50%',1),
If(Sum(Attained)/Sum(Possible) > 0.5, dual('>50%,3),dual('=50%',2)
)
)
,Student)
and a single expression / measure
=Count(DISTINCT Student)

Re: Pie chart, count scores  lower, middle, upper
Kristan Sears Sep 24, 2017 11:55 AM (in response to Stefan Wühl )Stefan,
This worked perfectly. I created a Field called "Score" instead of students. How can I modify this calculated dimension, to filter the scores by Subject, i.e. Mathematics? If I put a selection filter in the App, it yields the correct results, but I want the pie chart to be static for each subject.
Here's my calculated dimension, which is working.
=Aggr(
If( Score < 0.5, dual('< 50%',1),
If( Score > 0.5, dual('>50%',3),dual('=50%',2)
)
)
, Score)
Here's my MODIFIED calculated dimension, which is working.
=Aggr(
If( {<AS_Subject = {'Mathematics'} >} Score < 0.5, dual('< 50%',1),
If( {<AS_Subject = {'Mathematics'} >} Score > 0.5, dual('>50%',3),dual('=50%',2)
)
)
, {<AS_Subject = {'Mathematics'} >} Score)
Thank you in advance for your help. Much appreciated. Also, the Bucket link is very helpful. Cheers.

Re: Pie chart, count scores  lower, middle, upper
Kristan Sears Sep 24, 2017 12:00 PM (in response to Kristan Sears)[EDIT] to the above. The modified script is NOT working. Sorry for the confusion. I can't figure out how to modify my reply post.

Re: Pie chart, count scores  lower, middle, upper
Bill Markham Sep 24, 2017 12:38 PM (in response to Kristan Sears)If you click Actions, bottom left of your post it should give you options for Edit

Re: Pie chart, count scores  lower, middle, upper
Kristan Sears Sep 24, 2017 1:50 PM (in response to Bill Markham )I tried that, but the link fails to load the options. It's just a continuous progress bar.

Re: Pie chart, count scores  lower, middle, upper
Stefan Wühl Sep 24, 2017 4:19 PM (in response to Kristan Sears)You can only use set analysis in combination with aggregation functions, like Sum(), Count() or Only()
It's hard to help you with the exact syntax without knowing a minimum about your data model, but adding Only() could solve your issue:
=Aggr(
If( Only( {<AS_Subject = {'Mathematics'} >} Score ) < 0.5, dual('< 50%',1),
If( Only({<AS_Subject = {'Mathematics'} >} Score) > 0.5, dual('>50%',3),dual('=50%',2)
)
)
, Score) //no aggregation for the aggr dimension




