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: 
lylererger
Creator II
Creator II

Straight Table Calculation for the Previous Date Formula

Hi friends!

Help to write the formula that calculates values for the previous period inside current period in chart.

Like on screenshot below:

111.PNG

Trying to calculate measure "VALUE PREV DATE"

Sum(Aggr(sum({<Date={"$(=If(Dimensionality()=0,
Date(MonthEnd(AddMonths(max(
Date),-1))),
Date(MonthEnd(AddMonths(max(
Date),-1)))))"}>}  [VALUE]),TB))


Doesnt works, because showing single value


Please help!


Thanks in advance.



11 Replies
MK_QSL
MVP
MVP

I am confused here.

TBDATEVALUEPREV DATEVALUE PREV DATE
101.01.201710002.01.2017200
202.01.201720003.01.2017300
303.01.201730004.01.2017400
404.01.201740005.01.2017500
505.01.2017500

How come 02.01.2017 is previous date for 01.01.2017?

lylererger
Creator II
Creator II
Author

Omg. My falt...

FINALLY: I has field wiht dates ( only with first dates of months ).

01.01.2017

01.02.2017

01.03.2017

01.04.2017

01.05.2017


The table should looks like that:

     

TBDATEVALUEPREV DATEVALUE PREV MONTH
101.01.201710001.12.2016-
201.02.201720001.01.2017100
301.03.201730001.02.2017200
401.04.201740001.03.2017300
501.05.201750001.04.2017400

I need to calculate measure "VALUE PREV MONTH".