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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
RutiTaumanRubin
Creator
Creator

Count compared to previous year- QlikSense

Hi everyone,

I want to create measure with the following calculate:

count of EMPLOYEES where field STATUS='ACTIVE' for this year and was 'NOT ACTIVE' for last year..

Any Advice?

Thank's!

1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

May be this

Count({<Emp = p({<Year = {"$(=Max(Year))"}, STATUS = {'ACTIVE'}>})*p({<Year = {"$(=Max(Year)-1)"}, STATUS = {'NOT ACTIVE'}>})>}Emp)

View solution in original post

4 Replies
OmarBenSalem
Partner - Champion II
Partner - Champion II

Maybe sthing like this:

count(

{

<STATUS={'ACTIVE'},Year={"$(=max(Year))"}>

*

<STATUS={'NOT ACTIVE'},Year={"$(=max(Year)-1)"}>


}


employee)

sunny_talwar
MVP
MVP

May be this

Count({<Emp = p({<Year = {"$(=Max(Year))"}, STATUS = {'ACTIVE'}>})*p({<Year = {"$(=Max(Year)-1)"}, STATUS = {'NOT ACTIVE'}>})>}Emp)

RutiTaumanRubin
Creator
Creator
Author

Thank you for your response !

it's not working..

OmarBenSalem
Partner - Champion II
Partner - Champion II

Suppose u have this:

EmployeeYearStatus
12018ACTIVE
12017NOT ACTIVE
22018ACTIVE

The result should be : 1 employee which is employee 1 because he was active in 2018 and inactive in 2017 or both employees because one of the conditions is met?

Because this works:

Count(distinct {<Employee = p({<Year = {"$(=Max(Year))"}, Status = {'ACTIVE'}>})*p({<Year = {"$(=Max(Year)-1)"}, Status = {'NOT ACTIVE'}>})>}Employee)


Capture.PNG