Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can u help me on this Set Expression!!!!!!

Count(DISTINCT{<DOJ_EMP={'<=$(MSTR_Year)'},EMP_Status={'Active'}>+<DH_Year={'>=$(MSTR_Year)'}>}EMPLOYEE_CODE)

Am using using OR in between EMP_Status ,DH_Year can u any one correct me

whether my expresssion wrong or wright

same formula i replicated with if condition it is fine

Count(DISTINCT if((DOJ_EMP<= MSTR_Year and (IsNull(DH_Year) or DH_Year > MSTR_Year)),EMPLOYEE_CODE))

when u comes to the set expression getting the problem 

3 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this expression

=Count(DISTINCT{<DOJ_EMP={'<=$(=MSTR_Year)'}, EMP_Status={'Active'}> + <DH_Year={'>=$(=MSTR_Year)'}>} EMPLOYEE_CODE)

If it not works then attach some sample file, what is the value in the MSTR_Year, DOJ_EMP and DH_Year do all those are in the same format?

Regards,

Jagan.

Not applicable
Author

MSTR_year in not a variable if i remove $ symbol the data could not display

and more over thanx rly i tried with this expression but it does not help

evan_kurowski
Specialist
Specialist

Hello manjunath,

Try this:
Count(DISTINCT {<DOJ_EMP={"<=$(=Max(MSTR_Year))"},EMP_Status={Active}>+<DH_Year={">=$(=Max(MSTR_Year))"}>} EMPLOYEE_CODE)

Also make sure that the fields DOJ_EMP and MSTR_Year are the same data type and values, I'm assuming looking at your expression they both need to be year numbers.  Use the Max() function to make your comparison against the maximum possible year, because if you pass the set-analysis multiple year values it won't understand against which possible value of many to begin it's comparison.