Last date of the selected quarter

hi all - I have been struggling to figure out how to get the last date of selected quarter. for example, if the user has selected 2014 Q1 from the date hierarchy, I want to show 2014-03-31.
any idea how to accomplish this? thanks in advance

Hi Sam,
There are several ways to do this in MDX.  
One way is to use LastChild a few times.  For example, if your hierarchy had Period, Week, and Day below Quarter, and you were sure the user had selected a Quarter (the MDX could check) try this assuming your date hierarchy is calle [Date].[Fiscal
Calendar].    [Date].[Fiscal Calendar].lastchild.lastchild.lastchild
  The first lastchild will get the last Period in the Quarter, the second lastchild the last week in that Period and the third lastchild will get the last day of that week.
Another way, which will work for any level they selected would be something like; assuming the Day level is called [TheDate].   Tail(Descendants([Date].[Fiscal Calendar],[Date].[Fiscal Calendar].[TheDate]),1).item(0)  The descendants
gets all the days in the selected period, the tail gets a set including just the last day, and Item(0) gets that particular day.
Of course, the MDX snippets above could be used in larger MDX expressions.
Hope that helps.  It really is worthwhile to learn a little MDX.  Remember, anything is possible in MDX if the cube has the data.
Richard

Similar Messages

  • Last date of the previous quarter

    Hi,
    How can i find the last date of the previous quarter, based on todays date (the fiscal year starting from 1st April)
    the quarters are 1st april to 30th June, 1st July to 30th sept, 1st Oct to 31st Dec and 1st Jan to 31st March

    872435 wrote:
    Hi,
    How can i find the last date of the previous quarter, based on todays date (the fiscal year starting from 1st April)
    the quarters are 1st april to 30th June, 1st July to 30th sept, 1st Oct to 31st Dec and 1st Jan to 31st MarchTry this function:
    select add_months(add_months(trunc(sysdate,'Q'),-1) - 1,1) from dual;
    Ion

  • Next quarter to the selected quarter

    Hi Experts,
    Our requirement is to show the data in the report for the next rolling up quarters to the selected quarter in the prompt.
    Ex. If user has selected 2010-Q2 then report should show the data for 2010-Q3, 2010-Q4,2011-Q1 and 2011-Q2.
    Please suggest, how to implement as we are just aware of AGO function in OBIEE.
    Thanks
    Meera

    You see, if course, that your first issue is that 2010-Q2 is a CHAR field and to apply time functions, you need to work with actual dates. So you will need to map the dates to the appropriate quarter and year. Once you have that, here is how to build it:
    1) TIMESTAMPADD(SQL_TSI_QUARTER,-1,TIMESTAMPADD(SQL_TSI_DAY,-(DAY_OF_QUARTER(yourdatecolumn))+1,yourdatecolumn))
    As I mentioned in the other thread that Kart quoted, the formula above will give you the first day of the quarter in which the date column exists. The date column is the one your user will pick. Now, to get the 4th quarter after this, use this SQL:
    2) TIMESTAMPADD(SQL_TSI_QUARTER, 4,TIMESTAMPADD(SQL_TSI_QUARTER,-1,TIMESTAMPADD(SQL_TSI_DAY,-(DAY_OF_QUARTER(yourdatecolumn))+1,yourdatecolumn)))
    The above SQL will give you the 4th quarter after the one in 1)
    Now you have your two endpoints. Build your filter on the time column in your report and it should be between 1) and 2).

  • To display Last Date of the Month in Financial Reporting studio 9

    Hi
    I want to display last date of the month in header in Financial Reporting studio 9 . Is there any function which displays the last date of the month as per user selection .
    for example
    If user select month of Jan it should display Jan 31st, 2009
    If user select month of Feb it should display Feb 28th 2009
    Thanks

    Unless you name your Months like that you cannot do it. A large team from a major consulting firm told me for a year that it was not possible and convinced management that financial statements don't need dates.
    Management decided that we do need dates (because all financials need dates, look at any text book). I figured out a pretty sweet solution that is simple and easy to use and maintain. The users love it. Management loves it.
    I'm not giving it away though.

  • Dynamic date in the selection according to fiscal year variant

    Hi
    Is it possible to set dynamic date input parameter from the fiscal year variant sap table (OB29 transaction).
    For example when I run valuation (F.05) I want the value date input field to be the last day of the previous period.
    Thanks
    Ofer

    Hi,
    The dynamic dates on the selection parameters may come from the variant.
    You need to create the variants accordingly to your requirements and specify how the date on the selection screen has to be calculated.
    You have different options for this purpose.
    T     T: Table Variable from TVARVC
    D     D: Dynamic date calculation

  • FM for the last date of the previos month

    Hi folks
    my requirement is if we enter the calendar month say YYYYMM in the selection
    screen. it has to get the previous month last date in the format DDMMYYYY
    For eg.,  selection screen input  200704
                required output : 31/03/2007
    Is there any standard function module.
    please urgent
    Thanks in Advance
    Rao

    Hi,
    Please try this.
    data: wa_idate like sy-datum,
          wa_odate like sy-datum.
    wa_idate(6) = p_date.
    wa_idate+6(2) = '01'.
    wa_odate = w_idate - 1.
    OR
    call function 'RP_CALC_DATE_IN_INTERVAL'
      exporting
        date      = wa_idate
        days      = 0
        months    = 1
        signum    = '-'
        years     = 0
      importing
        calc_date = wa_odate.
    write: / 'Last date of the previous month: ', wa_odate.
    Regards,
    Ferry Lianto

  • 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 find FIRST and the LAST date of the month.

    Hello,
    I want to find the first and the last date of the current month through query. How is it possible please help.
    For example if the current month is july. The first date should be 01-JUL-2006 and the last date would be 31-JUL-2006.
    Please help me.
    Regards,
    Imran Baig

    Like this?
    SQL> select trunc(sysdate,'MM') "First_Day",
      2        last_day(sysdate) "Last_Day" from dual;
    First_Day Last_Day
    01-JUL-06 31-JUL-06
    SQL> select trunc(to_date('10-FEB-04'),'MM' ) "First_Day",
      2       last_day(to_date('10-FEB-04')) "Last_Day" from dual;
    First_Day Last_Day
    01-FEB-04 29-FEB-04

  • Terms of Payment to determine due date as last date of the month

    Hi Experts,
    Does any one know how to configure a Terms of Payment to determine due date as last date of the month ?
    I tried by puting fixed date as 31 in the Terms of Payment in FI but when I am creating in FI-CA it gives me an error "_Term of payment Z003 is inconsistent/not planned_"
    Please advice.
    Thanks & Regards
    Satyajeet

    Hi Satyajeet,
    It seems the settings that you have maintained in FI are correct.
    When you are assigning the payment terms in FI-CA, you need to assign a factory calendar as well to the payment terms in the following config-
    IMG->Financial Accounting ->Contract Accounts Receivable and Payable->Postings and Documents->Document->Maintain Payment Terms
    If you have already assigned the factory calendar and still the problem persists, can you give the message ID and the message number of the error that you are getting?
    Thanks,
    Amlan

  • Want last date of the month as default basic finish date for the Proc order

    For forward scheduling type in process order, irrespective of the start date i want last date of the month as my  basic finish date.
    Ex start date can be 01/10/2009 or 15/10/2009, but the basic finish date should be 31/10/2009.

    Hi Sam,
    sorry to say , its not possible in standard SAP.
    1) If, on order creation, a planned order exists for the production order/ process order, the basic dates are copied from the planned order.
    2)If no planned order exists on order creation, you must specify at least one basic date.
    The scheduling type determines the basic dates that you must specify. and it useses timings from routings for scheduling.
    so may be you need some work around.
    explain your requirement why do you want to fix it for the last day of month and other constraints, may be we can find some way.
    Regards
    Ritesh

  • FISCAL year from Date  in the Selection Screen.

    Hi Folks,
    Is there any function module which returns the Fiscal year if we provide the date in ranges.
    I mean, I have a select option for date in the selection screen.So,if a user enters the date say 01042007 01042007 it should return the corresponding fiscal year.
    Kindly let me know if anyone here has any idea regarding this.
    Thanks,
    K.Kiran.

    Hello,
    Check these FM's
    FTIS
    FTI_FISCAL_YEAR_MONTH_GET
    KBPA                           Budget/Plan - application-specific
    KBPA_GET_START_FISCAL_YEAR     Determine Start Year for Funds Management
    KBPA_GET_START_FISCAL_YEAR_OPT
    Vasanth

  • Last Date of the next month

    Hi,
    How to find the last date of the next month.
    Thanks in advance
    Sunitha

    Use the below mentioned FM
      call function 'LAST_DAY_IN_PERIOD_GET'
        exporting
          i_gjahr              = p_finyear
          i_periv              = 'X1'
          i_poper              = lv_popere
        importing
          e_date               = p_edate
        exceptions
          input_false          = 1
          t009_notfound        = 2
          t009b_notfound       = 3
          others               = 4.
      if sy-subrc <> 0.
      endif.
    Supply the proper parameters, u will get the last date in  the next month.

  • Determine previous date from the selection date

    Hi Guys,
    I need to get a previous date from the selection date mm/dd/yyyy
    Eg:
    Selection date is 02/28/2008
    Sol- -02/27/2008
    Selection date - 03/01/2008
    Sol- 02/29/2008
    Selection date - 04/02/2008
    Sol-04/01/2008
    If i do ofset -1 in query ....it goes -1 month. In Exit if i do Sys-datnum -1. It works but not in case for Feburary month. Since 2008 year has Feb (29 days) but for 2007 (28 days)
    Regards

    Hi,
    Problem is i have a 0Date restricted to a variable and if i do offset-1 to that variable it goes previous month not the date.
    I dont have 0CALDAY in my cube. Can i do in the UserExit.
    If i do sy-datum-1. Will it work?
    Because the FEb one is the main problem
    Regards

  • Please help.........how can i get the last date of the month?????

    Hello....
    I want to get the last date of the month.
    For example, the last date of Jan is 31.
    How can I get the last date of the particular month and year ????
    Thanks for help.
    Gloria

    Hi Gloria
    1. How can I compare the date???date1.compareTo(date2)
    where date1 and date2 is a java.util.Date Object
    will return 0 if it is the same date
    or
    date1.after(date2)
    where date1 and date2 is a java.util.Date Object
    will return true if date1 is after date2
    (the same for date1.before)
    2. How can I change the date format into yyyymmdd format???? I just want the year, month and date.try the java.text.SimpleDateFormat Object
    new SimpleDateFormat("yyyymmdd").format(yourdate)
    Hope this help.
    Please also have a look at a calendar I wrote, (maybe it help)
    demo & source :
    http://www.geocities.com/globe_software/java/components/
    globe_sa

  • Last date of the month

    Hi All,
    Can anyone tell me the logic to get the last date of the month for vbrk-fkdat. The date format is dd/mm/yyyy. i need the output on the same format.
    for ex: if vbrk-fkdat = 17/12/2007 the output should be 31/12/2007.
    Thanks,
    Madhu

    actually the FM only takes date like sy-datum. but my variable is
    i had made the changes like -
    data: gv_date(10) TYPE c,
            gv_date1(10) TYPE c.
    CONCATENATE wa_vbrk-fkdat6(2) wa_vbrk-fkdat4(2) wa_vbrk-fkdat+0(4) INTO gv_date SEPARATED BY '/'.
      REPLACE ALL OCCURRENCES OF '/' IN gv_date WITH '.'.
          CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
            EXPORTING
              day_in            = gv_date
            IMPORTING
              last_day_of_month = gv_date1.
    REPLACE ALL OCCURRENCES OF '.' IN gv_date1 WITH '/'.
    but its showing the error as the variable declaration is different as it is in FM, i.e FM contains date type sy-datum.
    please reply ASAP.
    Thanks,
    madhu

Maybe you are looking for

  • PSE9 installation problem on Mac pro---xmas gift

    Help!!! I am new to PS and received PSE9 as a gift from my sis and b-i-l for Xmas. Just getting around to install it and have received  the following, upon 2 times I tried to install it... Exit Code: 7 -------------------------------------- Summary -

  • Getting Error message while open a SWF file from desktop and any other location

    dear all., I am using Flash CS4, when I publish SWF movie and open it directly from directories I get an error message. (The image of error message attached, Plz, help me to short out this problem. ASAP. Thanks in advance.

  • Linking to a page not created by iWeb?

    Good day everyone - Just a quick question, is there a way to link to a webpage not created by iWeb. I don't currently own iWeb, but it is coming with my new MBPro. I really like the way Adobe Lightroom creates SWF pages for gallery use, can I create

  • Adaptive-Firewall (af) blacklist or blockedHosts? Packet-Filter (pf)

    I have just upgraded my Mac mini Server from the latest version of OS X 10.8.5 and OS X Server 2.2.1 to OS X 10.9.3 and OS X Server 3.1.2 by turning off all server services (except Open Directory), upgrade to OS X 10.9.3 and touching up System Prefer

  • Slide show bug

    Has anyone else tried to create large slide shows? This does not seem to work. I used 55 photographs in a slide show (flash elements). When selecting transitionType Random it did not work at all. When selecting transitionType Rotate it successfully s