Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm looking to create a gauge that works differently depending on what has been selected from the calendar.
so, if [CalMonth] is selected the calculation needs to be
Count((BedDaysPatientID))
/
((Sum({<CalDay={1}>}Data)/2)*Count(CalDay))
if [CalDay] is selected the calculation will be
Count(Distinct(BedDaysPatientID))
/
((Sum(Data)/2)*Count(CalDay))
How do i write the calculation based on the above?
Thanks
Kev
sorry, i missed the last ")"
if(GetSelectedCount(CalDay)>0,Count(Distinct(BedDaysPatientID))/((Sum(Data)/2)*Count(CalDay)),
if(GetSelectedCount(CalMonth)>0,Count((BedDaysPatientID))/((Sum({<CalDay={1}>}Data)/2)*Count(CalDay))
) )
if(GetSelectedCount(CalDay)>0,Count(Distinct(BedDaysPatientID))/((Sum(Data)/2)*Count(CalDay)),
if(GetSelectedCount(CalMonth)>0,Count((BedDaysPatientID))/((Sum({<CalDay={1}>}Data)/2)*Count(CalDay))
)
What will happen is when you select callmonth and callday it's gonna use callday calculation.
I hope this works
sorry, i missed the last ")"
if(GetSelectedCount(CalDay)>0,Count(Distinct(BedDaysPatientID))/((Sum(Data)/2)*Count(CalDay)),
if(GetSelectedCount(CalMonth)>0,Count((BedDaysPatientID))/((Sum({<CalDay={1}>}Data)/2)*Count(CalDay))
) )
Superb, works perfectly, if I then want to add [CalYear] as a third layer?
you just need to add another if like this:
if(GetSelectedCount(CalDay)>0,Count(Distinct(BedDaysPatientID))/((Sum(Data)/2)*Count(CalDay)),
if(GetSelectedCount(CalMonth)>0,Count((BedDaysPatientID))/((Sum({<CalDay={1}>}Data)/2)*Count(CalDay)),
if(GetSelectedCount(CalYear)>0,/*YOUR CODE HERE*/
) ))
That's what I assumed but it didn't work. I'll take another look. thank you
So, this work brilliantly -
if(GetSelectedCount(CalDay)>0,Count ({<WardCode={'Grattan'}>}Distinct(BedDaysPatientID)),
if(GetSelectedCount(CalMonth)>0,Count({<WardCode={'Grattan'}>}(BedDaysPatientID))))
However when I try to add CalYear
if(GetSelectedCount(CalDay)>0,Count ({<WardCode={'Grattan'}>}Distinct(BedDaysPatientID)),
if(GetSelectedCount(CalMonth)>0,Count({<WardCode={'Grattan'}>}(BedDaysPatientID))),
if(GetSelectedCount(CalYear)>0,Count({<WardCode={'Grattan'}>}(BedDaysPatientID))))
It doesn't work and I get an error in expression: If takes 2-3 parameters