Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
tmumaw
Specialist II
Specialist II

Before / After calculations

Good morning everyone.  I'm having a little problem using the before and after functions in a calculation and could use a little help.

I have a dimension called office:

1320 Denver in 2019 they had 569 customers, then in 2018 they had 854, then in 2017 they had 1,025.  I thought I could use the following to determine the increase or decrease in customer counts from the previous year.  For some reason it's not giving me what I expected to see.  Any help?  Thanks

Count({<YTDFlag = {1}>} DISTINCT [Ship To]) - After(Count ({<YTDFlag = {1}>} DISTINCT [Ship To]))

Labels (1)
1 Solution

Accepted Solutions
rubenmarin

Then it should work, chek atachment. Maybe the set analysis is restricting data?

Try setting to different expressions to check if they return the expected values, like in Test table

View solution in original post

4 Replies
rubenmarin

Hi, Before and After can work in pivot tables with vertical dimensions (columns).

For rows you can try with Below instead of After

tmumaw
Specialist II
Specialist II
Author

I know that.  What I have is a pivot table with years across and sales offices down.

1370 Denver  2019 / 500  (+250)      2918 / 250  (-100)     2017 / 350  (+200)     2016 / 150 (-150)     2015 / 300

 

I'm trying to get then numbers in (*)

rubenmarin

Then it should work, chek atachment. Maybe the set analysis is restricting data?

Try setting to different expressions to check if they return the expected values, like in Test table

tmumaw
Specialist II
Specialist II
Author

Thanks.  It was the set analysis.  Which is very strange (you would think it would work).