7 Replies Latest reply: Apr 25, 2012 5:57 AM by Celambarasan Adhimulam

# 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.

• ###### how to convert if condition to set analysis.

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

• ###### how to convert if condition to set analysis.

hi Sunil,

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

thanx

Savi.

• ###### Re: how to convert if condition to set analysis.

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

• ###### Re: how to convert if condition to set analysis.

hi Sunil,

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

thanx Savi.

• ###### Re: how to convert if condition to set analysis.

it s better you can upload a sample file.

• ###### Re: how to convert if condition to set analysis.

Hi,

Check with this

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

Celambarasan

• ###### Re: how to convert if condition to set analysis.

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