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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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.

Labels (1)
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])