
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using Addmonths in IF Statement for Dimension
Hi,
I use this if statement but it does not bring back 2 months, it brings back all available months in a Year.
if(date#(GLPeriod.PeriodNameRP,'MMM-YY') >= $(=addmonths(date#(only(GLPeriod.PeriodName),'MMM-YY'),-2))
,date#(GLPeriod.PeriodNameRP,'MMM-YY'))
Please let me know if i did any wrong.
Thanks
Dev
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It worked when i created the function as variable
vMonth5 variable is set with =addmonths(date#(only(GLPeriod.PeriodName),'MMM-YY'),-5)
and in IF
=if(date#(GLPeriod.PeriodNameRP,'MMM-YY') >= vMonth5
,date#(GLPeriod.PeriodNameRP,'MMM-YY'))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try below expression
if(Date(date#(GLPeriod.PeriodNameRP,'MMM-YY')) >= Date(addmonths(Date(date#(Min(GLPeriod.PeriodName),'MMM-YY')),-2))
,Date(date#(GLPeriod.PeriodNameRP,'MMM-YY')))
-Shwetha A

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It worked when i created the function as variable
vMonth5 variable is set with =addmonths(date#(only(GLPeriod.PeriodName),'MMM-YY'),-5)
and in IF
=if(date#(GLPeriod.PeriodNameRP,'MMM-YY') >= vMonth5
,date#(GLPeriod.PeriodNameRP,'MMM-YY'))
