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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
saifuddin
Contributor III
Contributor III

same day last year expression

Hi All,

I need some help with a problem I am trying to solve. 

raw data.png

I am trying to

--count distinct People_ID for the selected year, selected Pay_period and on the Max Number_day which from user selection. (works fine)  =count({$< Number_Day={'$(=$(vMaxDay))'} >}(People_ID))

 

--Count People_id for the previous year of the selected year but for the same Number_Day as currently selected year and disregarding Pay_Period selection.

 

Example:

For the above data in excel file. Below is the current selection.

=count({$< Number_Day={'$(=$(vMaxDay))'} >}(People_ID))  Result 3

$vMaxDay=6

 

Previous year from my calculation

 

=count({$< Year={$(=Year-1)},pay_period=, Number_Day={'6'} >}DISTINCT(People_ID))

And Result of count should be 1.

current Year.png

 

I added 6 manually. It’s basically  max Number_Day of the current selection. Number_Day has to be dynamic.

Appreciate your help

Regards

Saif 

Labels (1)
1 Solution

Accepted Solutions
Claudiu_Anghelescu
Specialist
Specialist

=count({< Year={$(vPrevYear)}, Pay_Period=, Number_Day={$(vMaxDay)} >}DISTINCT(People_ID))

 

 

To help community find solutions, please don't forget to mark as correct.

View solution in original post

1 Reply
Claudiu_Anghelescu
Specialist
Specialist

=count({< Year={$(vPrevYear)}, Pay_Period=, Number_Day={$(vMaxDay)} >}DISTINCT(People_ID))

 

 

To help community find solutions, please don't forget to mark as correct.