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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Previous Year Sum

I'm having trouble showing data for the previous year in a Pivot Table.

I have an expression:

sum([staff member])

with Dimensions:
Region, Dept, Period

and wanted to add another expression as:

sum(year={<year-1>} [staff members])

have tried many different options but none seems to work. I'm using a Pivot Table.

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try: sum({<year={'$(=only(year)-1)'>} [staff members]).

Note, you can't also use year as a dimension in your pivot chart and you need to select one year.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

This one is alsno not working.

Should I calculate totals in my script? Or should I change to another chart type from Pivot Chart ?

Anonymous
Not applicable
Author

Any suggestions ?

subathra
Partner - Contributor III
Partner - Contributor III

Hi try this,

sum({<year={$(=Max(year)-1)}>}[staff members])