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: 
demaina
Contributor II
Contributor II

Set analysis to compare data at two differents date

Hello,

I am a beginner in Qliksense and I have a question on the use of set analysis.

My data are formatted like this : [Date] , [ID], [Contract], [availability], it is a database that record everyday if employees are available and what is their contract (CDD, CDI)

I would like to compare two different dates in order to know how many employees are CDI and how many are CDD

I have 2 dates picker with 2 differents alternatives states : Date1 and Date2

I don't manage to have the correct KPI corresponding to the selected date. 

My expression is : =Count({<Contract={'CDI'}>}Distinct ID)

And this KPI is affected by Alternative State "Date1"

Could you please help me ? 

 

Labels (1)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you want to reference the alternate state in your expression, use the state name as the set identifier:

=Count({Date1 <Contract={'CDI'}>}Distinct ID)

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

View solution in original post

3 Replies
agigliotti
Partner - Champion
Partner - Champion

Hi @demaina ,

Could you please explain better what is the actual result and the expected one?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you want to reference the alternate state in your expression, use the state name as the set identifier:

=Count({Date1 <Contract={'CDI'}>}Distinct ID)

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

demaina
Contributor II
Contributor II
Author

Hello,
Thank you ! 
It works : I put the KPi in an alternative state "Date1" and the following expression seems to work : "Count({<Contrat={'CDI'}, Working={'yes'},Date={date1}>}Distinct Identifiant)"