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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Previous period in one column with current (pivot table)

I am wondering, it is possible to get previous period sum in one column with current period?

for ex. now, i have table like this:

I use  this formula for calculating last period

=SUM({$< Field1 = {'Income'} ,  Period = {"$(=

                                                   '>=' & NUM(ADDYEARS(MIN(Period),-1))  & '<=' & NUM(ADDYEARS(MAX(Период),-1)) 

                                                                  )"}>}  Value)

1 Solution

Accepted Solutions
sunny_talwar

Try this

Before(Sum({$<Field1 = {'Income'}, Period = {"$(='>=' & Num(AddYears(Min(Period), -1)) & '<=' & Num(AddYears(Max(Период), -1)))"}>} Value))

Read about Before/After here

Missing Manual - Before() and After()

View solution in original post

3 Replies
sunny_talwar

Try this

Before(Sum({$<Field1 = {'Income'}, Period = {"$(='>=' & Num(AddYears(Min(Period), -1)) & '<=' & Num(AddYears(Max(Период), -1)))"}>} Value))

Read about Before/After here

Missing Manual - Before() and After()

stabben23
Partner - Master
Partner - Master

use another Dimension than year maybe?

Anonymous
Not applicable
Author

Sunny, thx =). It's helped