Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
AnnaEKinch
Partner - Contributor III
Partner - Contributor III

The count of values for a period plus count of values for the same period last year

Hi!

This is my formula for counting No of Employees:

count({< Numbers_Flag={1}, TransType={'Resource'}>}distinct EmployeeNo)

The columns of my table has periods in the format 'YYYYMM'

I want each column to count the No of Employees for that period PLUS the number of employees for the same period last year.

So for example in the column for 202011 I would like to have  the count of employees in 202011 + the count of employees in 201911. In the next column ie  202012, I would like the count of 202012 + count of 201912.

Is this possible?

Thanks,

Anna.

Labels (2)
3 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Anna,

Do you have a small example data set, then I can create a test. It's probably something like adding year into your set analysis -> {$< Year = {"=$(=Max(Year) -1"}>}

Jordy

Climber

Work smarter, not harder
AnnaEKinch
Partner - Contributor III
Partner - Contributor III
Author

Thanks so much Jordy, here's some data 🙂

AnnaEKinch
Partner - Contributor III
Partner - Contributor III
Author

I tried Year = {"=$(=Max(Year) -1"} but it unfortunately did not work.

I even tried this which didn't work either 😞

=Count({<Period={"=$(=Period-Left(Period,4)*100+(Left(Period,4)-1)*100)"},Numbers_Flag={1}, TransType={'Resource'}>}distinct EmployeeNo)