Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert if condition to Set

Hi All,

I am having following if condition which needs to be converted into Set analysis

Count((if([DB DATE]>=$(Start_date) And (DB_DATE)<=$(End_date),[Instrument No])))

-Jay

Labels (1)
5 Replies
tresB
Champion III
Champion III

Count({<[DB DATE]={'>=$(Start_date) <=$(End_date)'}>} [Instrument No])

tamilarasu
Champion
Champion

Hi,

Try,

Count({<[DB DATE]={">=$(Start_date)<=$(End_date)"}>}[Instrument No])

sunny_talwar
MVP
MVP

In addition to the below comments, I would also make sure that $(Start_date) and $(End_date) has same format as DB DATE for this to work. You can check this by adding ='>=' & $(Start_date) & '<=' & $(End_date) to a text box object to check if you get the date range you want in the same format as DB Date.

Colin-Albert
Partner - Champion
Partner - Champion

If you add the set expression column with a blank label, you can see the evaluated set expression in the column label without needing to create an extra text box.

sunny_talwar
MVP
MVP

Agreed Colin‌, but I usually use the text box approach because next step for me is to just copy the the whole text box expression and put it between dollar sign expansion ->  $(=TextBoxExpression).

In this case -> Count({<[DB DATE]={"$(='>=' & $(Start_date) & '<=' & $(End_date))"}>}[Instrument No])

You may not like my approach, but this gives the exact same result and make me feel like I am in control of what is going on

Best,

Sunny