Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

qliksus
Valued Contributor

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????

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Regarding in set analysis coding

You can try

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


Avoiding that failure in set analysis.

6 Replies
MVP
MVP

Regarding in set analysis coding

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
Valued Contributor

Regarding in set analysis coding

Hi,

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

MVP
MVP

Regarding in set analysis coding

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

qliksus
Valued Contributor

Regarding in set analysis coding

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

MVP
MVP

Regarding in set analysis coding

You can try

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


Avoiding that failure in set analysis.

qliksus
Valued Contributor

Regarding in set analysis coding

Hi Miguel,

It's working fine. Thanks for your reply.

Community Browser