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 condition in an expression

I'm trying to find the percentage of employees particiates in a program (ie. if RWJF_403BER_AMOUNT>0 then they are participant) as of today for the current year where the employee category is one of the following 'Full Time Regular','Full Time Contract','Part Time Regular'

.  Then I want to find for the quarter to date as well.

There will be no selection from the user and just a number to be displayed. So I'm trying something like this.

=num((Count ({<
             
RWJF_403BER_AMOUNT = {<(if (RWJF_403BER_AMOUNT>0,RWJF_403BER_AMOUNT)>},
              EMPLOYMENT_CATEGORY = {'Full Time Regular','Full Time Contract','Part Time Regular'},
                                Year= {
$(=max(Year))}
              >} DISTINCT
[EMPLOYEE_NUMBER])
              /
       count({<Year={
$(=max(Year))}
             >}
             DISTINCT
[EMPLOYEE_NUMBER])), '#,##0%')

Please help.

Thanks

3 Replies
Anonymous
Not applicable
Author

Hello, try this

=num(

     (Count({$<RWJF_403BER_AMOUNT = {'>0'},EMPLOYMENT_CATEGORY = {'Full Time Regular','Full Time Contract','Part Time Regular'},Year= {$(=max(Year))}>} DISTINCT [EMPLOYEE_NUMBER])
              /
       Count({$<Year={
$(=max(Year))}>}DISTINCT [EMPLOYEE_NUMBER])

     ), '#,##0%')

Not applicable
Author

Thanks Diego,

One more question, if I have to compare a date instead of

RWJF_403BER_AMOUNT = {'>0'} then how will I do that?

can I use this,  I get 0.00 instead 0.012 for 3 termination out of 239 employees

=num(

     (
Count({$<TERM_DATE = {'>0'},EMPLOYMENT_CATEGORY = {'Full Time Regular','Full Time Contract','Part Time Regular'},Year= {$(=max(Year))}>} DISTINCT [EMPLOYEE_NUMBER])
              /
      
Count({$<Year={$(=max(Year))}>}DISTINCT [EMPLOYEE_NUMBER])

     ), '#,##0.##%')

Thanks again

Anonymous
Not applicable
Author

you can do this,

TERM_DATE = {'>=$(=Makedate(2013,01,01))'}