Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Battling with an IF statement in a Sum Fields Function

Hi guys,

i cant seem to get this one right, please can someone assist me with this?

sum({$<ClaimStatus={'Approved','Picked','Dispensed'}>}

(if(MedicalAidSchemeOptionID = 1811 or 1812 or 1813 or 1814 and tempSEP<114, (tempSEP*0.12),

if(MedicalAidSchemeOptionID = 1811 or 1812 or 1813 or 1814 and tempSEP>=114, 13.68,

if(MedicalAidSchemeOptionID = 1679 or 1676 or 803 or 463 or 1600 or 1761 or 1009 or 1694 or 1263 or 1010 or 308 or 307and tempSEP<114, (tempSEP*0.20),

if(MedicalAidSchemeOptionID = 1679 or 1676 or 803 or 463 or 1600 or 1761 or 1009 or 1694 or 1263 or 1010 or 308 or 307 and tempSEP>=114, 22.80,

[Service Fee 1]))))))

1 Reply
Gysbert_Wassenaar

Try:

sum({$<ClaimStatus={'Approved','Picked','Dispensed'}>}

          if( tempSEP < 114,

                    if(match(MedicalAidSchemeOptionID,1811,1812,1813,1815), tempSEP*0.12,

                              if(match(MedicalAidSchemeOptionID,1679,1676,803,463,1600,1761,1009,1694,1263,1010,308,307),tempSEP*0.20)

                    ),

                    if(match(MedicalAidSchemeOptionID,1811,1812,1813,1815), 13.68,

                              if(match(MedicalAidSchemeOptionID,1679,1676,803,463,1600,1761,1009,1694,1263,1010,308,307),22.80)

                    )

          )

)


talk is cheap, supply exceeds demand