Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
shanky1907
Creator II
Creator II

Convert IF into SET analysis

I have this code which is written with IF condition, Please help me with converting it into SET analysis

=Count((IF(STATUS<>'Cancelled' Or STATUS<>'Expired' or STATUS<>'Pending Expiration',

IF(REG_Flag>=1 or MED_Flag>=1 or LEG_Flag>=1 ,If(CalendarYear=$(vCurrentYear),object_name)))))

Any leads will be helpful.

8 Replies
simondachstr
Luminary Alumni
Luminary Alumni

Hi Shashank,


This statement doesn't make sense to me as they cancel each other out. Are you sure it's not an AND statement?

STATUS<>'Expired' or STATUS<>'Pending Expiration'

manideep78
Partner - Specialist
Partner - Specialist

Hi Shashank

You wrote only true condition in the above mentioned IF statement. So my doubt is what if the above condition is false. But I understood that you are taking only true conditions to get some value. please try the below expression which I wrote from the above situation with little understanding. It could be better if you can elaborate more.

Count({<STATUS-={'Cancelled','Expired', 'Pending Expiration'},

              REG_Flag ={">=1"}, MED_Flag={">=1"}, LEG_Flag={">=1"},

              CalendarYear={$(vCurrentYear)} >}object_name)

Hope this helps.

Regards,
Manideep

israrkhan
Specialist II
Specialist II

=Count((IF(STATUS<>'Cancelled' Or STATUS<>'Expired' or STATUS<>'Pending Expiration',

IF(REG_Flag >=1 or MED_Flag >=1 or LEG_Flag >=1 ,If(CalendarYear=$(vCurrentYear),object_name)))))

try like below...

Count({<STATUS -={'Cancelled' , 'Expired' , 'Pending Expiration'},

REG_Flag = {">= 1"}, MED_Flag={">=1"}, LEG_Flag={">=1"},

CalendarYear ={$(vCurrentYear)} >} object_name)

qlikoqlik
Creator
Creator

HI

Try the below, in qlikview you have add a minus sign infront of = to mean not equal to

Count({<STATUS-={'Cancelled','Expired','Pending Expiration'},

              REG_Flag -={'1'}, MED_Flag-={'1'}, LEG_Flag-={'1'}>}

              CalendarYear={$(vCurrentYear)} object_name)

Regards

Padma

maxgro
MVP
MVP

count({$

     <STATUS=-{'Cancelled','Expired','Pending Expiration'},REG_Flag={">1"}>*<CalendarYear={$(vCurrentYear)}>

     +<STATUS=-{'Cancelled','Expired','Pending Expiration'},MED_Flag={">1"}>*<CalendarYear={$(vCurrentYear)}>

     +<STATUS=-{'Cancelled','Expired','Pending Expiration'},LEG_Flag={">1"}>*<CalendarYear={$(vCurrentYear)}>

     } object_name)

senpradip007
Specialist III
Specialist III

Try this

Count({<STATUS -={'Cancelled','Expired','Pending Expiration'}, CalendarYear={'$(vCurrentYear)'}, REG_Flag -={1}>} object_name)

+

Count({<STATUS -={'Cancelled','Expired','Pending Expiration'}, CalendarYear={'$(vCurrentYear)'}, MED_Flag -={1}>} object_name)

+

Count({<STATUS -={'Cancelled','Expired','Pending Expiration'}, CalendarYear={'$(vCurrentYear)'}, LEG_Flag -={1}>} object_name)

israrkhan
Specialist II
Specialist II

qlikOqlik


REG_Flag -={'1'}, MED_Flag-={'1'}, LEG_Flag-={'1'}......???

what if he has REG_Flag =0 or -1?, and MED_Flag= 0 or -1 ? and LEG_Flag = 0 or -1 ???



shanky1907
Creator II
Creator II
Author

yes...if any of the statement occurs... then the condition must be false