Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
nevilledhamsiri
Specialist
Specialist

How to incorporate "and" and "or" condition to set analysis

Hi Community members,

I am little struggling to add the above to my set expression, Please see below & help me to do that

SUM({<BRANCH_CODE='RA00','EH00','K700','K900','EM00','AS00','TA00','MY00','KW00','LW00','PA00','GD00','BL00','PB00'},BALANCE_CF={"=BALANCE_CF=1000"},PAID_AMOUNT={"=PAID_AMOUNT=0"}>}BALANCE_CF)

(As per above, I need to say Balance CF to be obtained when Balance CF=1000 and when paid amount ( which is a another expression)=0


Sum({<CLASS_CODE={'MC','M4','M3','CH','PP'}, CLAIM_NO = {"=MONTHS_PROVISION > 500000"}>}MONTHS_PROVISION)

As per 2nd one, I need to add OR function which is like when MONTHS_PROVISION OR UNDER_OVER ADJUSTMENT>500000, then give me either under_over adjustment or months provision which ever exceeds Rs 500000.(Note UNDER_OVER ADJUSTMENT is a another expression)

  Sunny helped me earlier to resolve some matters owing to this. This particular issue I could not forward. Please look in to this

Many Thanks

Neville

1 Solution

Accepted Solutions
sunny_talwar

May be this... again I am not 100% sure

Sum({<CLASS_CODE = {'MC', 'M4', 'M3', 'CH', 'PP'}, CLAIM_NO = {"=MONTHS_PROVISION > 50000"}>} MONTHS_PROVISION) +

Sum({<CLASS_CODE = {'MC', 'M4', 'M3', 'CH', 'PP'}, CLAIM_NO = {"=UNDER_OVER_PROVISION > 50000"}>} UNDER_OVER_PROVISION)

View solution in original post

18 Replies
sunny_talwar

Are there two requirements you are looking to resolve here? I am slightly confused as to what you are looking to get

nevilledhamsiri
Specialist
Specialist
Author

Yes,

1st requirement is to

BALANCE_CF should be equal to Rs 1000/=, while paid amount on the clam =0 (in other wards no payment has been made on the claim).To satisfy the said conditions, I have arranged the set expression as below but expected output is not possible.

SUM({<BRANCH_CODE='RA00','EH00','K700','K900','EM00','AS00','TA00','MY00','KW00','LW00','PA00','GD00','BL00','PB00'},BALANCE_CF={"=BALANCE_CF=1000"},PAID_AMOUNT={"=PAID_AMOUNT=0"}>}BALANCE_CF)

2nd requirement is as below.

Sum({<CLASS_CODE={'MC','M4','M3','CH','PP'}, CLAIM_NO = {"=MONTHS_PROVISION > 500000"}, OR ''OVER_UNDER_ADJUSTMENT>500000''>}MONTHS_PROVISION OR OVER_UNDER_ADJSTMENT)

May be the expression written is wrong. I have no idea how OR function to be added to set expression. Simply I have to find out the claim on which either Month_provision or Over_under_adjustment exceeds Rs 500000/=.

Sunny , You may incorporate this condition to the 1st expression given above.

Thanks for responding

Neville

nevilledhamsiri
Specialist
Specialist
Author

Hi Sunny

If you are free, please refer to this & help me!

Many Thanks

Neville

sunny_talwar

Try this for 1st

Sum({<BRANCH_CODE = 'RA00', 'EH00', 'K700', 'K900', 'EM00', 'AS00', 'TA00', 'MY00', 'KW00', 'LW00', 'PA00', 'GD00', 'BL00', 'PB00'}, BALANCE_CF = {'1000'}, PAID_AMOUNT = {'0'}>} BALANCE_CF)

For 2, which field you want to sum? MONTHS_PROVISION or OVER_UNDER_ADJSTMENT? Set analysis can look like this

Sum({<CLASS_CODE = {'MC', 'M4', 'M3', 'CH', 'PP'}, CLAIM_NO = {"=MONTHS_PROVISION > 500000 or OVER_UNDER_ADJUSTMENT > 500000"}>} MONTHS_PROVISION OR OVER_UNDER_ADJSTMENT)

nevilledhamsiri
Specialist
Specialist
Author

Hi Sunny, Sorry for the delay in response. Was out of home! I copied your two expressions. I do not get the results once it is applied. I forward my PT with excel to refer where I have gone wrong. Please see to this.

Neville

nevilledhamsiri
Specialist
Specialist
Author

Please refer data attached!

nevilledhamsiri
Specialist
Specialist
Author

Sunny,

Please look in to this if you are free!

Thanks

Neville

nevilledhamsiri
Specialist
Specialist
Author

Dear Sunny!

Can you please look in to this. I have attached my data for you to check.

Thanks

Neville

sunny_talwar

Sorry about the delay, checking it now