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: 
Not applicable

how to convert if condition to set analysis.

Hi All,

I want to convert  this if condition to set analysis.

if(Status='arias' and (Count( Status ) >1) ,Count ( DISTINCT Fac_no ))

thanks

Savi.

1 Solution

Accepted Solutions
SunilChauhan
Champion
Champion

sorry

count({<Status={'arias'},Count( Status ) ={">1"}>} DISTINCT  Fac_no )

or

aggr(count({<Status={'arias'},Count( Status ) ={">1"}>} DISTINCT  Fac_no ),Fac_no )

hope this helps

Sunil Chauhan

View solution in original post

7 Replies
SunilChauhan
Champion
Champion

count({<Status={'arias'},Count( Status ) >1>} DISTINCT  Fac_no )

or

aggr(count({<Status={'arias'},Count( Status ) >1>} DISTINCT  Fac_no ),Fac_no )

hope this helps


Sunil Chauhan
Not applicable
Author

hi Sunil,

thanx Sunil. but this is not working , there is a mistake. can u fix it.

thanx

Savi.

SunilChauhan
Champion
Champion

sorry

count({<Status={'arias'},Count( Status ) ={">1"}>} DISTINCT  Fac_no )

or

aggr(count({<Status={'arias'},Count( Status ) ={">1"}>} DISTINCT  Fac_no ),Fac_no )

hope this helps

Sunil Chauhan
Not applicable
Author

hi Sunil,

there is a mistake, can u check if u dont mind.

thanx Savi.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Looking at the two bits of code (IF and Set Analysis) it would appear these will give different results.  In the instance with the IF statement a count of all Fac_no's will be given if any Status is greater than one.  In the set analysis example a count of Fac_no's where the status is greater than one will be given.

The later sounds more useful, but it is a different result.

- Steve

SunilChauhan
Champion
Champion

it s better you can upload a sample file.

Sunil Chauhan
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Check with this

     Count ( {<Status={'arias'}>*<Status={"=Count(Status)>1"}>}DISTINCT Fac_no )

Celambarasan