Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

sahilmahajan7
New Contributor

Help with set analysis example

In one KPI i have Headcount


and i have a filter as Months

now what i want is when i select Feb it should give me the headcount for jan in a new KPI

the expression i am writing is

count( {$<[As_On link.autoCalendar.Month]={Jan}>} distinct EmployeeNo )

but i want to achieve this by not mentioning jan i want it to give me headcount for current selection - 1

Thanks

1 Solution

Accepted Solutions
agigliotti
Honored Contributor II

Re: Help with set analysis example

try the below expression:

count( {< [As_On link.autoCalendar.Month] = {"$(=Max([As_On link.autoCalendar.Month])-1)"} >} distinct EmployeeNo )

4 Replies
agigliotti
Honored Contributor II

Re: Help with set analysis example

try the below expression:

count( {< [As_On link.autoCalendar.Month] = {"$(=Max([As_On link.autoCalendar.Month])-1)"} >} distinct EmployeeNo )

MVP
MVP

Re: Help with set analysis example

Your autocalender should contain a field named [MonthsAgo] and by using that instead you could have an expression like this:

Count( {$<[As_On link.autoCalendar.MonthsAgo]={1}>} DISTINCT EmployeeNo )


This also works for December/January where you can't just subtract one from January and get December.

zebhashmi
Valued Contributor

Re: Help with set analysis example

count( {$<[As_On link.autoCalendar.Month]={'Jan'}>} distinct EmployeeNo )

sahilmahajan7
New Contributor

Re: Help with set analysis example

thank you so much