Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
marieclaire
Contributor

What is the syntax of an expression with "if", "count distinct", comparing 2 values ?

Hi everybody,


i need to calculate a number of sales by distinct ID, comparing 2 values :
if(min(p.Contenu) <= num(p.Event),1)

Anybody could help me to use the right syntax ?

I tried many things as

count(distinct(if(min(p.Kiosque) <= num(p.Event),[Visites ID])))

Thank you for your help.

 

3 Replies
Channa
Valued Contributor III

Re: What is the syntax of an expression with "if", "count distinct", comparing 2

TRY

IF(min(p.Kiosque) <= num(p.Event),COUNT( DISTNCT [Visites ID],0)

Channa
pradosh_thakur
Honored Contributor II

Re: What is the syntax of an expression with "if", "count distinct", comparing 2

HI

 

It completely depend upon where you are using the expression . Still you may try this

count({<[Visites ID]={"=min(p.Kiosque) <= num(p.Event)"}>}[Visites ID])

Thanks

Pradosh

Learning never stops.

Re: What is the syntax of an expression with "if", "count distinct", comparing 2

Perhaps this?

count(distinct if(min(p.Kiosque) <= num(p.Event),[Visites ID]))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)