MDX to get last date MEMBER associated with a time LEVEL

Hi there,
I need to come up with a MDX calculation in my cube that takes an average 90 days forward from the last date member associated with whatever time level is being viewed in a time hierarchy.  Is this something anyone could help me with?  I can come
up with code that is specific to a level (Year, Month, Week) but not one that is dynamic.
Best,
D

I don't know exactly what you want from me.  I have a Time dimension with Year, Semester, Quarter, Month and Date.  I want to be able to get to the last date associated with a time member. So, for example, I would want to derive like this...
October 31, 2014 would get to October 31, 2014
October 2014 would get me to October 31, 2014
Quarter 3 would get to to September 30, 2014
Semester 2, 2014 would get me to December 31, 2014
2014 would get me to  December 31, 2014

Similar Messages

  • How to get last date of the week

    hi,
    how to get last date of the week like FM WEEK_GET_FIRST_DAY gives the date of the first day of the week i need the date of the last day of the week..
    thnx

    data : p_week type KWEEK,
    p_Date type SYDATUM.
    p_week = <incoming value in week of year>
    CALL FUNCTION 'WEEK_GET_FIRST_DAY'
    EXPORTING
    week = p_week
    IMPORTING
    DATE = p_date
    EXCEPTIONS
    WEEK_INVALID = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    To get the last day of the week.
    p_date = p_date + 6.
    You can find the available fm in the system from se37 transaction code.

  • Getting path to application associated with file type

    Hello,
    I'm looking for a platform-independent way to get path to application associated with given file type. Desktop API introduced in JSE 1.6 seems to do this, but it only lanuches the app.
    Any suggestions will be apprecieted

    Okay then, how can I open the file in it's associated
    application AND get the Process object of app's
    instance?If it doesn't bother you that the app will only work on windoze, then you can use the shell "start" command on the file.
    Process proc = Runtime.getRuntime().exec(new String[]{"cmd", "/C","start",filePath});However waitFor() will only wait for the process to be launched, not completed. Since your program doesn't know what Windoze will choose to launch, this makes sense.

  • What is the syntax to get last date of Quarter ?

    Hi ,
    We are planning to have Bom effective date functionality. Presently BOM Disable date is coming in between the Quarter. Is there any funtion or syntax to get last date of quarter for the bom disable date. similar to "$begin" to get the last date.
    Thanks

    Hi,
    To get this done you can do the following.
    1. Create the Result Source.
    2. Create the display template using the design manager and copy the existing template make the req. changes on the template and publish it to the document library and give the manage property that you req. for this concatenation functionality. Manage Property
    like the domain etc.
    3. Create search center and add the new page modified the core result web part and give the result source and custom template that created in step 2.
    4. Publish the page.
    5. Create the Search vertical and give the name and use the same page the created in step3. 
    http://sharepointfordeveloper.blogspot.in/2013/09/sharepoint-2013-result-source.html
    http://sharepointfordeveloper.blogspot.in/2013/09/sharepoint-2013-result-types.html
    http://sharepointfordeveloper.blogspot.in/2013/06/sharepoint-2013-design-manager.html

  • HT204053 I have a phone number associated with face time. how can I delete it?

    I have a phone number associated with face time. how can I delete it?

    You mean from your iPhone?  Don't think this is possible.

  • Getting last date of month

    Dear Experts
    Please help, i am new in ABAP.
    I want to get number of days for a particular month .Eg if user selects feb as moth and 2009 as year i will get 28.02.2009 as output.
    if user selects march and 2009 as year it will automatically returns 31.03.2009..
    Also give me function module coding for selection of month and year.
    I whouls be highly thankful to you for this.
    Regards
    Raj Jindal

    Hi Raj,
    DATA:
      w_date type sy-datum.
    CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
      EXPORTING
        day_in                 = '20090214' " pass the date here for which u want the last date
    IMPORTING
       LAST_DAY_OF_MONTH       = w_date
    EXCEPTIONS
       DAY_IN_NO_DATE          = 1
       OTHERS                  = 2
    IF sy-subrc <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Write:
      w_date.
    With luck,
    Pritam.

  • URGENT - BI Publisher - Get Last Date of Month/Year

    Hello,
    I want to get the last date of a year/month through BI Publisher. We want to do it by creating a list of values containing the month/year name (i.e. January, February, March for month or 2004 2005 2006 for year) and when the user selects one of this values to get the last date of the month or year in order to select the correct number of records.

    Hi,
    try with a LOV like the following:
    select
    to_char(add_months(trunc(sysdate,'MONTH'),-level),'Month - YYYY') display_value,
    last_day(add_months(trunc(sysdate,'MONTH'),-level)) return_value
    from dual
    connect by level <=12
    which gives you the last 12 month from today.
    Regards
    Rainer

  • How to get  --Last date of the Last value .

    Dear All,
    I have a report like
    Material – Country – Current Price
    1112-----  Singapore  -
      100
    1112-----  Japan  -
      120
    1112-----  Malesia   -
      99
    Here current price is Last Value of the particular Material on particular Date.
    This I can get based on Key figure Aggregation ( Last Value and reference Character 0CALDAY ), It is giving the last Value of the Particular Material.
    Now my user wants to see Last date of the value ( Date of the Value )
    Example :-
    Material – Country –  Date --Current Price
    1112-----  Singapore  -
    01/04/2008 -- 100
    1112-----  Japan  -
    04/05/2008 -- 120
    1112-----  Malesia   -
    05/05/2008 -- 99
    If  I drill down the date in my  report  it is showing all dates , my user wants to see only last date .
    Hope some one has solved this issue , please help me to solve this issue.
    Regards,
    SHAIK.

    I have created a keyfigure with date as a data type.
    In aggregation tab, I selected  aggregation Maximum.
    Upto DSO, data is Loaded perfect. Ok.
    I added the same key figure in cube , When I am trying to Activate the Transformation,
    It is giving Error message.
    Rule 17 is invalid and is being deleted. The reason for this is that a field or InfoObject that is used in rule 17 has been deleted in the source or target of the transformation ODSO ZPL_DSO1 -> CUBE ZPLATT_C (0GH6MHANQ2J79LXZBLGIJ9ZK9LWHK6RS)
    Plz Advice.
    Regards,
    SHAIK
    Edited by: shaik on May 7, 2008 5:46 PM

  • How to get last date of mapping execution?

    Hi all,
    Anybody knows how to get the last run date mapping? I try to develop incremental load, but i don´t know get the last date of mapping execution ok.
    anybody can help me, thanks in advanced

    Hi,
    In our project we also use last_run_date to detect the delta for incremental loading.
    We created a table which holds the run date and time for each mapping. When a mapping is new (initial load) the run date is set to 01/01/1900.
    In each mapping we added a post-mapping process that inserts a record in the process table with the mapping name and last run date.
    We also added a Constant operator to all mappings, calling a procedure to get the last_run_date out of our own process table.
    The constant attribute is then used in a FILTER operator to compare the dates and select only dates after the last run date.
    ==============================
    An other option is to use the get this information out of the runtime audit tables.
    ALL_RT_AUDIT_EXECUTIONS which reside in the runtime owner schema.
    Regards,
    Ilona

  • Get Last date of every Month in a year

    Hi All,
    I need to find last date of month for given year.
    Example:
    I used to pass date or year such as 2012 or 01-01-2012(DD-MM-YYYY)
    SQL query needs to return last date of every month such as
    31-01-2012
    28-02-2012
    31-03-2012
    30-04-2012
    31-12-2012
    for above requirement i have written the following SQL
    select rownum as row_count,
    case when rownum=1 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as Jan_month,
    case when rownum=2 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as Feb_month,
    case when rownum=3 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as mar_month,
    case when rownum=4 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as apr_month,
    case when rownum=5 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as may_month,
    case when rownum=6 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as jun_month,
    case when rownum=7 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as jul_month,
    case when rownum=8 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as aug_month,
    case when rownum=9 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as sep_month,
    case when rownum=10 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as oct_month,
    case when rownum=11 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as nov_month,
    case when rownum=12 then last_day(to_date(add_months(trunc(to_date('01-01-2012','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end as dec_month
    from dual connect by level <= 12 order by rownum;
    Result
    Jan_Month
    Feb_Month
    Mar_Month
    Apr_Month
    may_month
    jun_month
    jul_month
    aug_month
    sep_month
    oct_month
    nov_month
    dec_month
    1
    31-01-2014
    2
    28-02-2014
    3
    31-03-2014
    4
    30-04-2014
    5
    31-05-2014
    6
    30-06-2014
    7
    31-07-2014
    8
    31-08-2014
    9
    30-09-2014
    10
    31-10-2014
    11
    30-11-2014
    12
    31-12-2012
    Excepted Result:
    am excepted result as single row such as
    Jan_Month
    Feb_Month
    Mar_Month
    Apr_Month
    may_month
    jun_month
    jul_month
    aug_month
    sep_month
    oct_month
    nov_month
    dec_month
    31-01-2012
    28-02-2012
    31-03-2012
    30-04-2012
    31-05-2012
    30-06-2012
    31-07-2012
    31-08-2012
    30-09-2012
    31-10-2012
    30-11-2012
    31-12-2012
    Kindly give me suggestion to archive above result.
    Thanks&Regards
    Sami

    I agree with Marcus Pivot is the way to go about this... But on the other hand you almost solved it yourself.. just a max function was needed for your expected output:
    select
    max(case  when rownum=1 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as Jan_month,
    max(case  when rownum=2 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as Feb_month,
    max(case  when rownum=3 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as mar_month,
    max(case  when rownum=4 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as apr_month,
    max(case  when rownum=5 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as may_month,
    max(case  when rownum=6 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as jun_month,
    max(case  when rownum=7 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as jul_month,
    max(case  when rownum=8 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as aug_month,
    max(case  when rownum=9 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as sep_month,
    max(case  when rownum=10 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as oct_month,
    max(case  when rownum=11 then last_day(to_date(add_months(trunc(to_date('01-01-2014','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as nov_month,
    max(case  when rownum=12 then last_day(to_date(add_months(trunc(to_date('01-01-2012','DD-MM-YYYY'), 'YYYY'), level - 1), 'DD-MM-YY')) end) as dec_month
    from dual connect by level <= 12 order by rownum;
    AND to avoid hardcoding you can also modify your query as :
    select
    max(case  when rownum=1 then last_day(to_date(to_char(rownum),'MM')) end) as Jan_month,
    max(case  when rownum=2 then last_day(to_date(to_char(rownum),'MM')) end) as Feb_month,
    max(case  when rownum=3 then last_day(to_date(to_char(rownum),'MM')) end) as mar_month,
    max(case  when rownum=4 then last_day(to_date(to_char(rownum),'MM')) end) as apr_month,
    max(case  when rownum=5 then last_day(to_date(to_char(rownum),'MM')) end) as may_month,
    max(case  when rownum=6 then last_day(to_date(to_char(rownum),'MM')) end) as jun_month,
    max(case  when rownum=7 then last_day(to_date(to_char(rownum),'MM')) end) as jul_month,
    max(case  when rownum=8 then last_day(to_date(to_char(rownum),'MM')) end) as aug_month,
    max(case  when rownum=9 then last_day(to_date(to_char(rownum),'MM')) end) as sep_month,
    max(case  when rownum=10 then last_day(to_date(to_char(rownum),'MM')) end) as oct_month,
    max(case  when rownum=11 then last_day(to_date(to_char(rownum),'MM')) end) as nov_month,
    max(case  when rownum=12 then last_day(to_date(to_char(rownum),'MM')) end) as dec_month
    from dual connect by level <= 12 order by rownum;
    Easy way: (without connect)
    SELECT LAST_DAY (TO_DATE (ROWNUM, 'MM')) AS Jan_month,
           LAST_DAY (TO_DATE (ROWNUM + 1, 'MM')) AS Feb_month,
           LAST_DAY (TO_DATE (ROWNUM + 2, 'MM')) AS Mar_month,
           LAST_DAY (TO_DATE (ROWNUM + 3, 'MM')) AS Apr_month,
           LAST_DAY (TO_DATE (ROWNUM + 4, 'MM')) AS May_month,
           LAST_DAY (TO_DATE (ROWNUM + 5, 'MM')) AS Jun_month,
           LAST_DAY (TO_DATE (ROWNUM + 6, 'MM')) AS Jul_month,
           LAST_DAY (TO_DATE (ROWNUM + 7, 'MM')) AS Aug_month,
           LAST_DAY (TO_DATE (ROWNUM + 8, 'MM')) AS Sep_month,
           LAST_DAY (TO_DATE (ROWNUM + 9, 'MM')) AS Oct_month,
           LAST_DAY (TO_DATE (ROWNUM + 10, 'MM')) AS Nov_month,
           LAST_DAY (TO_DATE (ROWNUM + 11, 'MM')) AS Dec_month
      FROM DUAL
    Cheers,
    Manik.

  • Standard FM to get the Serial Numbers associated with the PO

    Hi,
    I'm using the Standard FM "BAPI_PO_GETDETAIL1" to get the details of the PO which I have created. The FM is returning the details such as PO HISTORY, POITEM, POHEADER etc. I want the serial numbers associated with the PO.
    Please help me to get the serial numbers which are issued to the PO since the material assigned to the PO is serialised material. Another Standard FM "BAPI_PO_GETDETAIL" also I have tried but there is no serial number collection in that FM.
    Thanks in Advance,
    Mohan.

    These function modules will not return you the serial number. May be you can use following logic.
    You can use table ser03 where in you wll input material document number and find out obknr. Pass this obknr to objk table and find out seril number.
    And to find the material document number for the relevant purchase order number you can use table EKBE.
    So for EKBe-BEWTYP= E and EBELN= purchase order find EKBE-MBLNR(belnr).
    The material document number and year  found above pass it to SER03-MBLNR and SEr03-mjahr and find SEr03-obknr.
    The obknr number found above pass it to OBJK and find serila numbers..
    Regards
    Sangeeta

  • Function Module to get Last date of previous year

    Is there any function module to get the Last date of the previous year. e.g, if i give date as 03/02/2009 the output  should be 31/12/2008.

    pls use below 2 FM's
    CALL FUNCTION 'MONTH_PLUS_DETERMINE'
              EXPORTING
                months  = -1
                olddate = curent_date
              IMPORTING
                newdate = w_prevdate.
    CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
              EXPORTING
                day_in            = w_prevdate
              IMPORTING
                last_day_of_month = w_lastdayprevmonth
              EXCEPTIONS
                day_in_no_date    = 1
                OTHERS            = 2.

  • To get last date of all the month in between year 2000 to 2100

    Hi all
    how we can make view that list last date of all the month in between year 2000 and 2100
    Thanks & regards
    vivek

    You would use the LAST_DAY() function:
    WITH months AS
         SELECT      TO_DATE('01/01/2000','MM/DD/YYYY') AS dt1
         ,     TO_DATE('12/31/2100','MM/DD/YYYY') AS dt2
         FROM     DUAL
    SELECT LAST_DAY(ADD_MONTHS(dt1,level-1)) LST_DAY_MONTHS
    FROM     months
    CONNECT BY LEVEL <= MONTHS_BETWEEN(dt2,dt1)+1Sample of results (too many to post):
    LST_DAY_MONTHS
    01/31/2000 00:00:00
    02/29/2000 00:00:00
    03/31/2000 00:00:00
    04/30/2000 00:00:00
    05/31/2000 00:00:00
    06/30/2000 00:00:00
    07/31/2000 00:00:00
    08/31/2000 00:00:00
    09/30/2000 00:00:00
    10/31/2000 00:00:00
    11/30/2000 00:00:00
    12/31/2000 00:00:00
    01/31/2001 00:00:00
    02/28/2001 00:00:00
    03/31/2001 00:00:00
    04/30/2001 00:00:00
    05/31/2001 00:00:00
    06/30/2001 00:00:00
    07/31/2001 00:00:00
    08/31/2001 00:00:00
    09/30/2001 00:00:00
    10/31/2001 00:00:00
    11/30/2001 00:00:00
    12/31/2001 00:00:00
    01/31/2002 00:00:00
    02/28/2002 00:00:00
    03/31/2002 00:00:00

  • How to get last date of month ?

    Dear all
    hi!!!
    How can I get the last date of a particular month?
    I mean if the month is Feb, last date of the month should be 28.
    Is it required to write in loop or there is any method to get it.
    Please write me urgently,
    thanx,
    Samir

    Hello ,
    You can get the last date of a particular month of a particular year like this :
    int year= 2000;
    int month=1;     // February (month is zero based )
    int date = 20;
    java.util.GregorianCalendar gc = new java.util.GregorianCalendar(year,month,date);
    int last_day = gc.getActualMaximum(Calendar.DAY_OF_MONTH));
    Sandip

  • Get last date of the current month

    Hi all,
       Is there any FM used to get the last date of
    sy-datum.
    Regards,
    bala

    check..
    RE_LAST_DAY_OF_MONTH
    SG_PS_GET_LAST_DAY_OF_MONTH
    parameters: p_fdate like sy-datum.
    DATA: M_DATE LIKE SY-DATUM,
    CALL FUNCTION 'LAST_DAY_OF_MONTHS' "#EC EXISTS
    EXPORTING
    DAY_IN = P_FDATE
    IMPORTING
    LAST_DAY_OF_MONTH = M_DATE.
    case mdate+3(2).
    when 30.
    write: '30 days'.
    when 28.
    write: '28 days'.
    when 29.
    write: '29 days'.
    when 31.
    write: '31 days'.
    endcase.

Maybe you are looking for

  • Ipod nano 4gb and ipod video 80g with windows vista

    hello! i've been trying (rather unsuccessfully) to sync the ipod nano to my laptop which has windows vista OS. i have the latest itunes 7.2 (just updated today from 7.1) and i always get the "found new hardware" pop-up everytime i plug the ipod nano

  • Error in Transaction code PRCCE

    Hi, I am facing a problem in ruuning the transaction code PRCCE.In that transaction code in the Field "Card Compamy" I put MC which is defined in the system and exected it and  Click on new entries to add missing transactions into the table. This wil

  • Question: 9i- 10g

    Hi all, What does anyone know or have an opinion regarding 10g's ability with Virtual Private Databases/Row level security and Unix based servers providing client-server forms and reports services to browser based windows and unix clients? My organis

  • How do I save a document/article so I can read when I am offline?

    I would like to know how can I save an article or a document I have downloaded so that I can open it againwhen I am offline (i.e. when I am not connected to the Internet).

  • How to turn off versions in Keynote??

    I use Keynote all the time in my work, and my files can be quite large--sometimes exceeding 1 gig in size.  To make a long story short, yesterday at the Apple Store, we discovered, after two Apple guys were tenacious enough to hang in there with me,