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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
vipin_mishra479
Creator II
Creator II

how to convert if condition to set analysis

Hi All,

count(distinct if( Date <= YearStartDate and Status = 3 and Area <> 'AP' and Area <> 'MH',EMPCODE))

here i have use year field in dimension.

5 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Here is the set expression.

     Sum({<Date = {">=$(YearStartDate)"},Status = {"3"},Area -= {"AP","MH"}>}Distinct EMPCODE)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
vipin_mishra479
Creator II
Creator II
Author

Hi koushik,

Expression is correct but in my Date field blank date is present i want include blank date also

but due to your expression it remove blank date expression

so please tell how to add blank date .

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Why dont u give some dummy Date.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

The expression you gave in your original post will also remove lines with a blank date. But to include with a set expression like this:

Count({<Date = {">=$(YearStartDate)"}, Status = {"3"}, Area -= {"AP","MH"}> +

<Date -= {"*"}, Status = {"3"}, Area -= {"AP","MH"}>} Distinct EMPCODE)

The -= will display a syntax error in the script editor, but you can ignore that (its a script editor bug).

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this expression

Sum({<Date -= {"*"} + {">=$(YearStartDate)"},Status = {"3"},Area -= {"AP","MH"}>}Distinct EMPCODE)


Hope it helps you.


Regards,

Jagan.