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: 
qliksus
Specialist II
Specialist II

Regarding in set analysis coding

Hi,

I have a two Data field and one stock filed and one stockcode field. i.e DATE1,DATE2,STOCKQTY,STOCKCODE.

Now i am writing one expression which is giving me correct answer.

i.e COUNT(DISTINCT IF(DATE1=DATE2 AND STOCKQTY>0, STOCKCODE))

now i want to write same thing in SET ANALYSIS . BUT I AM UNABLE TO WRITE THE CORRECT SYNTAX.

CAN ANYONE HELP ME???????

BECAUSE I WANT SIMULTANEOUSLY FOR LAST CONSECUTIVE MONTHS WHAT IS STOCKCODE COUNT????

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

You can try

Count({< STOCKQTY = {">0"} >} DISTINCT IF(DATE1 = DATE2, STOCKCODE))


Avoiding that failure in set analysis.

View solution in original post

6 Replies
Miguel_Angel_Baeyens

Hello,

As far as I'm concerned, syntax would be something like (untested):

Count({< DATE1 = DATE2, STOCKQTY = {">0"} >} DISTINCT STOCKCODE)


Expression within brackets is the set analysis.

Regards.

qliksus
Specialist II
Specialist II
Author

Hi,

Thanks for reply. But unfortunately it is not giving the correct answer. it is giving me count is 0.

Miguel_Angel_Baeyens

Are dates in the same format? I took into account DATE1 and DATE2 as fields, is that correct?

qliksus
Specialist II
Specialist II
Author

hi,

Both are fields. Ans both are same format because if they are bot in same format then how output is coming when i write COUNT(DISTINCT IF(DATE1=DATE2,CODE)0

Miguel_Angel_Baeyens

You can try

Count({< STOCKQTY = {">0"} >} DISTINCT IF(DATE1 = DATE2, STOCKCODE))


Avoiding that failure in set analysis.

qliksus
Specialist II
Specialist II
Author

Hi Miguel,

It's working fine. Thanks for your reply.