Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

compare result to result in second month of year

I want to compare the number of employees with the number of employees in month 2 , as a percentage where month 2 is 100%.

I have two dimensions year and month. and an expression:

count(distinct employeenum)/before(count(distinct employeenum, month-2)

 

In a pivot table it works fine using the before() function.

However I want to present the result in a line chart, but cannot get it done. The before function() does not work in a line chart right ? Is there an alternative way to do this ?

1 Solution

Accepted Solutions
curiousfellow
Specialist
Specialist
Author

Thank you for your answer, but it did not help.

When I use above,  it compares to x years before.

I solved it with this expression :

count(distinct employeenum)/count({<month={2}>} Total <year> employeenum)

I used something like this before, but did forget it 😁

 

View solution in original post

2 Replies
zhadrakas
Specialist II
Specialist II

before() and after() are pivot table exclusive functions.
check above() and below() for the use in line charts.

regards
tim
curiousfellow
Specialist
Specialist
Author

Thank you for your answer, but it did not help.

When I use above,  it compares to x years before.

I solved it with this expression :

count(distinct employeenum)/count({<month={2}>} Total <year> employeenum)

I used something like this before, but did forget it 😁