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: 
Not applicable

Multiple if conditions in expression

Hello,

I am using the below expression in my chart to find out the Departments without any employees:

=Sum(Aggr(IF(Count(Distinct Employee ID)=0,1),Department))

What if I want to display the Departments without any employess for those whose city is 'NY' or ''LN' in the same chart?

Could anyone help me on this?

Thanks.

8 Replies
its_anandrjs
Champion III
Champion III

Try like if your expression works

=Sum({<city= {'NY', 'LN'}   >} Aggr(IF(Count(Distinct Employee ID)=0,1),Department))

Or

=Sum( if( Match(city,'NY', 'LN'),     Aggr(IF(Count(Distinct Employee ID)=0,1),Department)))

Not applicable
Author

Thanks Anand.

I am trying to use it in this set analysis expression but geting error.

=count({<DEPT_ID=e({<EMP_ID={*}>}DEPT_ID)>})

Could you guide me on how to use it?

Not applicable
Author

I tried this but getting incorrect results.

=count({<DEPT_ID=e({<E_ID={*},city={'NY','LN'}>}DEPT_ID)>}DEPT_ID)

sasikanth
Master
Master

HI

try Some thing like below

=count({<EMP_ID={'0'},ciry={'*'}-{'NY','LN'}>}DEPT_ID)

or

count({<City={'*'}-{'NY','LN'}>} if(isNull(EMP_ID),DEPT_ID))

Not applicable
Author

Hi, try this below expression it might helps you

=Count({<city= {'NY', 'LN'}, E_ID={"=(Count(E_ID)=0)"}>} DEPT_ID)

Regards,

Satish

Not applicable
Author

I tried all the above combinations but its still not working for me

its_anandrjs
Champion III
Champion III

Sorry for late response busy for some urgent works let me know what is your expected output. If have a data then provide please.

Not applicable
Author


Thanks, I got it now.