Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
dandaanilreddy
Creator III
Creator III

Set analysis need to add condition

Hello Qlik Developers

I have the below expression. I want to calculate this for Regions "Direct" and "IVF" only. Can someone help me.

=num(

sum(if(Reported_Out_actual.count_idTBD_actual<>0 and Reported_Out_actual.BillType='Awaiting Order Entry',Reported_Out_actual.count_idTBD_actual))

,'###,###')

Thanks

Anil

1 Solution

Accepted Solutions
sunny_talwar

May be this:

=Num(

Sum({<Region = {'Direct', 'IVF}>} If(Reported_Out_actual.count_idTBD_actual<>0 and Reported_Out_actual.BillType='Awaiting Order Entry',Reported_Out_actual.count_idTBD_actual))

,'###,###')

View solution in original post

4 Replies
sunny_talwar

May be this:

=Num(

Sum({<Region = {'Direct', 'IVF}>} If(Reported_Out_actual.count_idTBD_actual<>0 and Reported_Out_actual.BillType='Awaiting Order Entry',Reported_Out_actual.count_idTBD_actual))

,'###,###')

View solution in original post

dandaanilreddy
Creator III
Creator III
Author

Thanks Bro

johnw
MVP
MVP

Or this, with the if() converted to set analysis as well. And it seems we don't need to check for the Reported_Out_actual.count_idTBD_actual not being 0, since adding a 0 won't affect the sum?

num(sum({

<Region={'Direct','IVF'}

,Reported_Out_actual.BillType*={'Awaiting Order Entry'}>}

Reported_Out_actual.count_idTBD_actual))

,'###,###')

johnw
MVP
MVP

Or even do similar in script if all these fields are on a single table, and you have the memory for it, and script time is less critical than chart time.

if(match(Region,'Direct','IVF')
and Reported_Out_actual.BillType='Awaiting Order Entry'
,Reported_Out_actual.count_idTBD_actual) as [Direct/IVF Awaiting Order Entry Count]

Then no set analysis or if() in the chart.

num(sum([Direct/IVF Awaiting Order Entry Count]),'###,###')