Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have created the below expression in a bar chart measure and the set analysis ignoring the "HospitalName" doesn't seem to work. Even when I replace {$<[HospitalName]=>} with {1} my selections are still taken into account. In other charts, I have created simpler expressions using the above set analysis and it works as expected. Is there something i am missing here?
=Aggr(Count({$<[HospitalName]=>} if((HandHygieneRecordsMapped.Action = 0 OR HandHygieneRecordsMapped.Action = 1) ,[HandHygieneRecordsMapped.Id])), [HospitalName])/Aggr(Count({$<[HospitalName]=>} [HandHygieneRecordsMapped.Id]), [HospitalName])
Thanks .
Hi
Try like below
Count({$<[HospitalName]=,HandHygieneRecordsMapped.Action={0}>+<[HospitalName]=,HandHygieneRecordsMapped.Action={1}>}[HandHygieneRecordsMapped.Id])
/
Count({$<[HospitalName]=>}[HandHygieneRecordsMapped.Id])
Modify like below
Aggr(
Count({<HospitalName>}
If(
HandHygieneRecordsMapped.Action = 0 OR HandHygieneRecordsMapped.Action = 1,
HandHygieneRecordsMapped.Id
)
),
HospitalName
) / Aggr(
Count({<HospitalName>} HandHygieneRecordsMapped.Id),
HospitalName)
Hi @PGeorge , How about this?
Count({$<[HospitalName]=,HandHygieneRecordsMapped.Action=0}>+<HandHygieneRecordsMapped.Action={1}>}[HandHygieneRecordsMapped.Id])
/
Count({$<[HospitalName]=>}[HandHygieneRecordsMapped.Id])
Hello Chanty4u,
Unfortunately, the results I get using the expression you shared are the same as mine.
The HospitalName is not ignored in my selections.
Hi BrunPierre,
The expression has an error in set modifier, so it doesn't give any results.
Missing a curly bracket, retry.
Count({$<[HospitalName]=,HandHygieneRecordsMapped.Action={0}>+<HandHygieneRecordsMapped.Action={1}>}[HandHygieneRecordsMapped.Id])
/
Count({$<[HospitalName]=>}[HandHygieneRecordsMapped.Id])
Thanks for your prompt answer.
The expression is valid now, when I select a HospitalName the chart doesn't filter out the selected HospitalName but it falsely recalculates the chart figures as shown below.
Hi
Try like below
Count({$<[HospitalName]=,HandHygieneRecordsMapped.Action={0}>+<[HospitalName]=,HandHygieneRecordsMapped.Action={1}>}[HandHygieneRecordsMapped.Id])
/
Count({$<[HospitalName]=>}[HandHygieneRecordsMapped.Id])
Assuming your original expression works fine except for the filter, here is a modified set.
Count({<[HospitalName]>} Aggr(Count({$<[HospitalName]=,HandHygieneRecordsMapped.Action={0}>+<HandHygieneRecordsMapped.Action={1}>}[HandHygieneRecordsMapped.Id]),[HospitalName]))
/
Count({<[HospitalName]>} Aggr(Count({$<[HospitalName]=>}[HandHygieneRecordsMapped.Id]),[HospitalName]))
Hi MayilVahanan,
Your approach is working as expected.
Could you please ellaborate on the syntax of the above expression which effectively ignores the HospitalName selection, or provide a documentation link (if there is any) where I could get more info?
Also, when i try to get the Median for the chart using the expression you provided i get "Nested aggregation not allowed" error. Is there a way to tackle it using the same expression?
Thanks.