Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Combination of Month and Year

I want to display three different dimensions with last 3  'Month Year' combination.

1st Dimension : date(makedate(Year(Now()),Month(Now())),'MMM YYYY')                    display JAN 2014

2nd Dimension: date(makedate(Year(Now()),Month(Now()))-1,'MMM YYYY')                  display DEC 2013

3rd Dimension: date(makedate(Year(Now()),Month(Now()))-2,'MMM YYYY')                   Still display DEC 2013

I expect 3rd dimension to display NOV 2013 but seems it's subtracting days and not month when using makedate() .

Any solution please ?

1 Solution

Accepted Solutions
Nicole-Smith

I would suggest going with the following:

1.  date(now(),'MMM YYYY')

2.  date(addmonths(now(),-1),'MMM YYYY')

3.  date(addmonths(now(),-2),'MMM YYYY')

View solution in original post

3 Replies
Or
MVP
MVP

You'll be wanting the AddMonths() function.

Not applicable
Author

Misplaced parenthesis?

date(makedate(Year(Now()),Month(Now()))-2,'MMM YYYY')

date(makedate(Year(Now()),Month(Now()) -2) ,'MMM YYYY')

Nicole-Smith

I would suggest going with the following:

1.  date(now(),'MMM YYYY')

2.  date(addmonths(now(),-1),'MMM YYYY')

3.  date(addmonths(now(),-2),'MMM YYYY')