BusinessObjects Board

Date functions with multi-source universes

Anybody have some examples of finding the last day of the current month using the IDT functions for multi-source universes? Or the first and last day of the previous month?

Similar unanswered question is here: http://scn.sap.com/thread/2128889

I searched on the “decrementDays” functions this forum and didn’t come up with anything.

Thanks,
Brett


bmedalen (BOB member since 2014-04-09)

Actually I just figured it out so I will post the answer I found out. I found something somewhat similar on an SCN post:

First_Day_Of_Current_Month_Date = decrementDays(curDate(), dayOfMonth(curDate())-1)

Last_Day_Of_Current_Month_Date = decrementDays(toDate(concat(leftStr(toString(incrementDays(toDate(concat(leftStr(toString(curDate()), 8), ‘01’)), 35)), 8), ‘01’)), 1)

First_Day_Of_Previous_Month_Date = toDate(concat(leftStr(toString(decrementDays(curDate(), dayOfMonth(curDate()))),8),‘01’))

Last_Day_Of_Previous_Month_Date = decrementDays(curDate(), dayOfMonth(curDate()))


bmedalen (BOB member since 2014-04-09)

Never heard of decrement. But I did post a load of dates formulae here that I found out by trial and error while working on a multisource IDT that sits over oracle and SQL server: DB-specific Relative Dates SQL Server, Oracle, Netezza, DB2

debbie


Debbie :uk: (BOB member since 2005-03-01)