5 Replies Latest reply: Nov 8, 2017 1:32 PM by Dave Melillo

# Max Period - 1 Not Working

I have periods in my data set formatted as 11/1/2017

The max period calculation is working

PERIOD = {"\$(=Max(PERIOD))"}

But the previous period calculation is not

PERIOD = {"\$(=Max(PERIOD)-1)"}

Any pointers here?

Thank you,

- dave

• ###### Re: Max Period - 1 Not Working

Hi,

what do you want exatly when you say -1 ? day -1, month -1, year -1 ?

• ###### Re: Max Period - 1 Not Working

So the periods are set up in a monthly fashion ... i.e

1/1/2017

2/1/2017

3/1/2017

etc ...

I want to sum({< PERIOD = {"\$(=Max(PERIOD)-1)"}>} AMT)) ... so if the max period is 3/1/2017 I want to return AMT for 2/1/2017

• ###### Re: Max Period - 1 Not Working

So, essentially you are going back a month? May be this

• ###### Re: Max Period - 1 Not Working

Works perfect thank you !!!

• ###### Re: Max Period - 1 Not Working

when you do math operation on a date value the resultant will be an Integer value, so there is a data type mismatch

to avoid that you must specify your date format for the field PERIOD

example

\$(=DATE(Max(PERIOD)-1)))  or  \$(=DATE(Max(PERIOD)-1,'DD/M/YYYY'))