cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure a calculated dimension with year change

peter_teussink2
Explorer
0 Kudos

Hi,

I'm trying to configure a calculated dimension with  a "Previous month-to-Date" calculation with a yearchange.

In the  document Calculiations best practice there is only an example which does'nt taking account to yearchange.

if month({date}) = Month(currentDate())-1 and Dayofyear({Date}) <= DayofYear(CurrentDate()) then {... }else 0

If the current month is january there will be no result.

Is there anybody who have a solution?

Thanks

Peter

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Peter

This formula keeps the last 30 days

if DateDiffInDays({Date}, CurrentDate()) <= 30 then {...} else 0

Regards

Sylvain

peter_teussink2
Explorer
0 Kudos

Hi Sylvain,

this is very usefull

thankd for your help

Regards Peter

Answers (0)