Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current month vs Previous month in pivot

Hi, guys!

I have a table as follows:

   

MonthsJan-15
Business GroupFTEHeadcountCurrent Month vs Previous Months
BG1107.31171
BG25.3560
BG357.82740
BG449.99550
BG51.971
BG617.7200
BG75.3881

I needed to find the difference betwenn Current month and previous month. I solved the problem with the expression:Count(Employee)-Before(Count( Employee))

However when I filter the table for 1 month, for example for January, it doesnt show me the difference:

   

MonthsJan-15
Business GroupFTEHeadcountCurrent Month vs Previous Months
BG1107.3117-
BG25.356-
BG357.8274-
BG449.9955-
BG51.97-
BG617.720-
BG75.388

-

Who knows what can be the reason of this problem?

3 Replies
Gysbert_Wassenaar

The problem is that you filtered the table. There's only on month left, so there's no month before that one month in the chart. There are ways to deal with that. See this document: Calculating rolling n-period totals, averages or other aggregations


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks for the reply, but the link that is given above isnt quite clear

Not applicable
Author

Guys,

I'm trying the expression like :

Count (Employee) - Count({<Months={$(=Max([Months])-1)} >} [Employee])

but it doesnt work