5 Replies Latest reply on Jan 14, 2016 8:28 PM by SriniVEERAVALLI

# How to calculate month end dates from all months?

Hi,

I am getting last day of current month. That formulae is

TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_MONTH , 1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)))

But, I want month end dates only from all months.i need  formula for this.

Thanks & Regards,

A.kavya.

• ###### 1. Re: How to calculate month end dates from all months?

Hi,

what does it means "for all months" for you?

Because there is an infinite number of months ....

Somewhere you must have dates or months or something and if you use that instead of CURRENT_DATE you will be able to calculate the last day of the references month.

Remember OBIEE never generate rows from nothing, so if you have a row / column referencing a month you can get the last day of that month, if you don't have anything OBIEE will not generate anything ...

• ###### 2. Re: How to calculate month end dates from all months?

Hello Kavya,

you can use repeat() function under string folder otherwise switch case option is there

regards

Sandeep

• ###### 3. Re: How to calculate month end dates from all months?

The REPEAT() function? this one will just output the first param as many times as the second one, so how is it supposed to give you end of month for all the months?

REPEAT('abc', 4) => 'abcabcabcabc' (so 'abc' 4 times)

And CASE WHEN will never generate any rows of data, if there aren't dates somewhere in the dataset it will never generate new columns with data inside.

• ###### 4. Re: How to calculate month end dates from all months?

Hello Kavya,

create new date column it must contain every month date ,

created date column pass  input to your expression .

new created column create as(New Calculated measure or New calculated Item or new Group )

regards

Sandeep

• ###### 5. Re: How to calculate month end dates from all months?

create min(date),max(date) fields in the rpd and set content level for Month level

or try