Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
If i break the following calculation in 6 seperate calculations they work find however in the form below (as i need it to be) it has an error - Garbage after expression:','
What am I doing wrong?
if(GetSelectedCount(CalDay)>0,(Count ({<WardCode={'Grattan'}>}Distinct(BedDaysPatientID)))*2
-
if(GetSelectedCount(CalDay)>0,Count ({<WardCode={'Grattan'},Leave={'Y'}>}Distinct(BedDaysPatientID))))
/
if(GetSelectedCount(CalDay)>0,(Sum({<WardCode={'Grattan'}>}Data))*Count(CalDay))
,
if(GetSelectedCount(CalMonth)>0,(Count({<WardCode={'Grattan'}>}(BedDaysPatientID)))*2)
-
if(GetSelectedCount(CalMonth)>0,(Count({<WardCode={'Grattan'},Leave={'Y'}>}(BedDaysPatientID)))*2)
/
if(GetSelectedCount(CalMonth)>0,(Sum({<CalDay={1},WardCode={'Grattan'}>}Data))*Count(CalDay))
It looks like you need to remove one of the closing brackets before the comma. All of your parenthesis are closed before the comma but after the comma is your else statement.
You may Try this - (check brackets)
if(GetSelectedCount(CalDay)>0,
(Count ({<WardCode={'Grattan'}>}Distinct BedDaysPatientID)*2
-
Count ({<WardCode={'Grattan'},Leave={'Y'}>}Distinct BedDaysPatientID))
/
Sum({<WardCode={'Grattan'}>}Data))*Count(CalDay)
,
if(GetSelectedCount(CalMonth)>0,
(Count({<WardCode={'Grattan'}>}BedDaysPatientID)*2
-
Count({<WardCode={'Grattan'},Leave={'Y'}>} BedDaysPatientID)*2)
/
Sum({<CalDay={1},WardCode={'Grattan'}>}Data))*Count(CalDay)
It looks like you need to remove one of the closing brackets before the comma. All of your parenthesis are closed before the comma but after the comma is your else statement.
You may Try this - (check brackets)
if(GetSelectedCount(CalDay)>0,
(Count ({<WardCode={'Grattan'}>}Distinct BedDaysPatientID)*2
-
Count ({<WardCode={'Grattan'},Leave={'Y'}>}Distinct BedDaysPatientID))
/
Sum({<WardCode={'Grattan'}>}Data))*Count(CalDay)
,
if(GetSelectedCount(CalMonth)>0,
(Count({<WardCode={'Grattan'}>}BedDaysPatientID)*2
-
Count({<WardCode={'Grattan'},Leave={'Y'}>} BedDaysPatientID)*2)
/
Sum({<CalDay={1},WardCode={'Grattan'}>}Data))*Count(CalDay)