Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
marieclaire
Creator
Creator

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
Specialist III
Specialist III

TRY

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

Channa
pradosh_thakur
Master II
Master II

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

Perhaps this?

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful