Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3316

Re: SAP BI Formula RelativeDate and currentDate

$
0
0

Hello Pavat,

 

Sorry for the mismatch. I did a confusion between [LY] and [CY].

So you want to add 8 month to Last Year and subtract 4 months to Current Year.

So the formula will be:

=If(MonthNumberOfYear([Key Date])<4

;FormatDate(RelativeDate([Key Date]; -125);"yyyyMM")

;FormatDate(RelativeDate([Key Date]; -120);"yyyyMM"))

 

In the first part of the expression, you add 8 months to Last Year: -365 + (8 * 30) = -125

In the second part of the expression, you subtract 4 months to Current Year: 30 * 4 = 120 + 365 = -120

 

Didier


Viewing all articles
Browse latest Browse all 3316

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>