on 2009 Aug 26 6:34 AM
Hi,
How to show last month end date based on the current date.
Eg:
Current date = "08/26/09"
Var- Last Month End Date = "07/31/09" etc...,
Please help me how to get it...
Thank You!
HI
Please use following formula.
=RelativeDate(CurrentDate();-DayNumberOfMonth(CurrentDate()))
--Kuldeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good to hear that it worked for you. but not for me.
I tried like this:
1st::
1. var1= ToDate("06/30/09","MM/dd/yyyy")
2.Var2= RelativeDate([Var1];-DayNumberOfMonth([Var1]))
result: 5/30/09
2nd:
RelativeDate('6/30/2009';-DayNumberOfMonth('6/30/2009'))
result: 5/30/09
Am working on SAP OLAP cubes.
Please help me where am going wrong....
Thank You!
Kuldeep , please tell me how to see MDX Query??
Thanks for reply Suresh.
Do you think it works...?? RelativeDate(CurrentDate();-DayNumberOfMonth(CurrentDate())) +1.
please test it from your end...,
It's not happening for all date selection. It's failing for 1st and last day selection only. like 6/1/09 or 6/30/09.
Adding of 1 to it is not good idea. Hope you got it.
In Web-I we have LastDayOfMonth() function...
Am trying to finding out any other way to do it... please someone help me.
Thank You!
Edited by: BOCP-BOE on Aug 26, 2009 5:20 PM
Hi,
It depends on your requirement
=RelativeDate(CurrentDate() ,-DayNumberOfMonth(CurrentDate())) +1 -> o/p is 01/08-2009
=RelativeDate(CurrentDate() ,-DayNumberOfMonth(CurrentDate()))
I have tried the above formula in BOXI R3 DeskI and its workin fine for me. i.e I got 7/31/2009 as o/p.
Cheers,
Suresh Aluri.
BOCP-POE:
what version of BusinessObjects are running? Certain versions of WebI of XIr2 have a problem with accuracy using Relativedate() due to a leap year computation it is one day off, but this problem does not occur in the DeskI version. It was supposed to be fixed in the 3.0 arena....
Thanks,
John
Thanks Kuldeep and all,
I got solution:
=If(Month([Current Date]) InList("January";"March";"May";"July";"August";"September";"December");LastDayOfMonth(RelativeDate([k5] ;-31));If(Month([Current Date]) InList("April";"June";"October";"November");LastDayOfMonth(RelativeDate([k5] ;-30));If(Mod(Year([Current Date]);4)=0;LastDayOfMonth(RelativeDate([k5] ;-29));LastDayOfMonth(RelativeDate([k5] ;-28)))))
Thank You!
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.