Want last month value of a Quarter instead of to-date value

Hi All
I have a report that has 2 columns : Quarter-year , Measure1. Quarter-Year can be drilled down to the month level. Now, what is happening is because I only have the Quarter-Year as the dimension column, I'm getting the cumulative (todate) value for the measure. Say I have Q1-2010 drills down to Jan - 10,000 .. Feb-20,000.. Mar-30,000... I want the report
to show the value as of March (the last month of the quarter): Q1-2010     30,000.
Instead I see the value as (10k+20k+30k = 60,000). Is there a way of achieving 30,000 value for Q1-2010 in Answers?
Thanks
Ananth
Edited by: Ananth V on Feb 4, 2010 8:54 AM

Excuse the re-edit, the instructions below will give you a level based measures. if you used function QUARTER_OF_YEAR(expr) you should be able to use a case statement below to only pull Quarters 3, 6, 9 and 12 (ie last quarters) in your measure definition, then use the level based mechanism if required.
Create another measure (duplicate your existing) and set the level of this measure to 'Quarter' by editing content tab on that measure or dragging it up to the Quarter level in your date hierarchy.
This will return the Quarter total , regardless of group by- you may need to set other levels in accordance with other dimensions used on the report.
Hope this helps,
Rgrds
Alastair
Edited by: Alastair_PeakIndicators on Apr 26, 2010 4:12 PM
Edited by: Alastair_PeakIndicators on Apr 26, 2010 4:13 PM

Similar Messages

  • Way to populate data for current quater months from last month of previous quater

    Hi  I have a requirement to load forecast data into the SSAS cube.
    My current data:
    Snapshot_M       Date         F_Quantities
    1/1/2014        1/1/2014    100
    2/1/2014        2/1/2014    90
    3/1/2014        3/1/2014    80
    4/1/2014        4/1/2014    23
    4/1/2014        5/1/2014    0
    4/1/2014        6/1/2014    0
    I want this two be shown as
    Snapshot_M       Date        F_Quantities
    1/1/2014        2/1/2014    100
    1/1/2014        3/1/2014    100
    1/1/2014        4/1/2014    100
    4/1/2014        5/1/2014     23
    4/1/2014        6/1/2014     23
    4/1/2014        7/1/2014     23
    Snapshot_M filed is the month when data was loaded.
    So to summarize, the data that is loaded in last month of fiscal Q1  (January) should serve as data for fiscal Q2 (Feb, Mar, APR), the data loaded on last month of Fiscal Q2 will serve as forecast data for Q3 an so on. ...
    Thanks  

    CREATE TABLE SAMPLEDATA(Snapshot_M DATETIME, Date DATETIME, F_Quantities INT)
    --fixed
    INSERT INTO SAMPLEDATA VALUES ('09/1/2013','09/01/2013',14)
    INSERT INTO SAMPLEDATA VALUES ('10/1/2013','10/01/2013',13)
    INSERT INTO SAMPLEDATA VALUES ('11/1/2013','11/01/2013',12)
    INSERT INTO SAMPLEDATA VALUES ('12/1/2013','12/01/2013',11)
    INSERT INTO SAMPLEDATA VALUES ('01/1/2014','01/01/2014',10)
    INSERT INTO SAMPLEDATA VALUES ('02/1/2014','02/01/2014',90)
    INSERT INTO SAMPLEDATA VALUES ('03/1/2014','03/01/2014',20)
    INSERT INTO SAMPLEDATA VALUES ('04/1/2014','04/01/2014',23)
    INSERT INTO SAMPLEDATA VALUES ('05/1/2014','05/01/2014',30)
    INSERT INTO SAMPLEDATA VALUES ('06/1/2014','06/01/2014',70)
    INSERT INTO SAMPLEDATA VALUES ('07/1/2014','07/01/2014',20)
    --Desired result set:
    Snapshot_M newdate F_Quantities
    2013-10-01 00:00:00.000 2013-11-01 00:00:00.000 13
    2013-10-01 00:00:00.000 2013-12-01 00:00:00.000 13
    2013-10-01 00:00:00.000 2014-01-01 00:00:00.000 13
    2014-01-01 00:00:00.000 2014-02-01 00:00:00.000 10
    2014-01-01 00:00:00.000 2014-03-01 00:00:00.000 10
    2014-01-01 00:00:00.000 2014-04-01 00:00:00.000 10
    2014-04-01 00:00:00.000 2014-05-01 00:00:00.000 23
    2014-04-01 00:00:00.000 2014-06-01 00:00:00.000 23
    2014-04-01 00:00:00.000 2014-07-01 00:00:00.000 23
    ;with mycte as (select *, lead(Date,1)Over(Order by date) newdate
    , Cast(Year(Snapshot_M) as char(4))+Cast(datepart(q, Snapshot_M) as char(1)) q
    , row_number() over(Partition by Cast(Year(Snapshot_M) as char(4))+Cast(datepart(q, Snapshot_M) as char(1)) order by date) rn
    ,count(*) over(Partition by Cast(Year(Snapshot_M) as char(4))+Cast(datepart(q, Snapshot_M) as char(1)) ) cnt
    from SAMPLEDATA
    ,mycte1 as (
    Select rn, q,
    (case when rn=1 then Snapshot_M end) Snapshot_M, newDate
    , (case when rn=1 then F_Quantities end) F_Quantities from mycte
    WHERE cnt=3)
    Select
    max(Snapshot_M) Over(partition by q) Snapshot_M
    ,newdate
    ,max(F_Quantities) Over(partition by q) F_Quantities
    from mycte1
    Order by newDate
    drop table SAMPLEDATA

  • Need records from the last month

    Hi, using Oracle 11g R2.
    On the last day of each month of each year, I'd like to query data from a table over the last month. For example, if today is December 31st, 2013, I'd like to query only records with a settlement_dt between (and including) Dec 1, 2012 and Dec 31, 2012. My process will run automatically at the end of each month, so I can't hard code the date values. I've developed the following solution, but I was wondering if anyone had other ideas.
    TO_CHAR(io.settlement_dt, 'MON')||TO_CHAR(io.settlement_dt, 'YYYY') =
                                   TO_CHAR(SYSDATE, 'MON')||TO_CHAR(SYSDATE, 'YYYY')
    Thanks!

    Hi,
    The most efficient way is
          io.settlement_dt >=             TRUNC (SYSDATE, 'MONTH')
    AND   io_settlement_dt <  ADD_MONTHS (TRUNC (SYSDATE, 'MONTH'), 1)
    This will allow the optimizer to use an index on io.settlement_dt.  Also, it involves only 3 function calls, regardless of how many rows are in the table (that is, no function has to be called for every row).

  • How to get the sales value of the last month in the quarter

    Hi,
    We have a requirement to get the "Sales" value against a quarter. We have 2 tables "Time" and "Sales". We want to display the Sales value against each quarter.
    But this should happen as follows.
    Consider quarter Q1 it should display the value of 3rd month, Q2 should display value for 6th month and so on..
    If in any particular Quarter we dont have a value for last month then it should display the value for 2nd month, if 2nd month value is also not present then it should display 1st month sales value.
    We are using excel as the database.
    Please let us know if anybody has a resolution to this.
    Regards,
    Apoorv Chitre

    hi,make an other column which will be the flag for the last months you want to be displayed...
    so ,in reports,you pass it as hidden column(by filter only the ones which have the appropriate flag),and then voila...
    i hope i helped
    http://greekoraclebi.blogspot.com/
    ///////////////////////////////////////

  • Identifying same values that existed previously (last month)?

    I am creating an OBIEE usage report and need help with a complex Column Formula.
    I want to identify returning users, that logged in this month AND last month.
    This logic might be something like:
    CASE WHEN User ID exists in Current Month = User ID that existed in the Previous Month then 1 else 0
    I have Month and User ID columns to work with in OBIEE Answers (no RPD access).
    Any idea of how to right a formuala that will compare non-measure values from last month to this month?
    Thanks!

    Roman,
    You can push down your current month and last month logic into Analytical view.
    In Time Attribute view, create two claculated measure for calender month. You can build this using "NOW" function, left functions. Once you have current month create last month leveraging current month and casting (current month -1)
    Once you have these two calculated attribute ready in your Time attribute view. Bring it to Analytical view and using "if then" function you can calculate measures for Current Month and Last Month.
    This will improve performance as it avoids jumps between various engine.
    Thanks

  • MDX to return last month of a quarter

    I have an MDX query where I need to return the last month of a quarter going back 2 years or 8 quarters.  I want the results to be like:
    Q1 2012   March 2012    #####
    Q2 2012   June 2012      #####
    Q4 2013   Dec 2013     #####
    I"ve tried this:  TAIL(Descendants(Lastperiods(8,STRTOMEMBER(@DataDate)), [Product Post Date].[Calendar].[Month] ),1 )
    but it's only returning the last monthe for the last Quarter and I need the last month for the last 8 Quarters.
    What am I doing wrong here ?   Thanks.
    J. Way

    You're welcome Judy!
    I'll do my best.  I think the simplest way to conceptualize the generate function (in this case, not the string concatination case for which it can also be used) is ...
    For each tuple/member in the first set (passed as a param), "apply" the 2nd set param to it.
    Union all the results together, and thereby "generate" a new set.
    What makes it useful is you can use CurrentMember to explicitly refer to members from the 1st set when doing this.
    Consider the following example ...
    As discussed in the
    MSDN definition, it is often used with TOPCOUNT.  If you need to show the top 10 products sold in each particular calendar year, generate a new set that for each year, derives the top 10 products, and then union all the results together into a newly
    generated set.
    Copy/paste from MSDN:
    ---------------------------------copy/paste start:
    The following example query displays the top 10 Products for each Calendar Year on Rows:
    SELECT
    {[Measures].[Internet Sales Amount]}
    ON 0,
    GENERATE(
    [Date].[Calendar Year].[Calendar Year].MEMBERS
    , TOPCOUNT(
    [Date].[Calendar Year].CURRENTMEMBER
    [Product].[Product].[Product].MEMBERS
    ,10, [Measures].[Internet Sales Amount]))
    ON 1
    FROM [Adventure Works]
    Note that a different top 10 is displayed for each year, and that the use of Generate is the only way to get this result. Simply crossjoining Calendar Years and the set of top 10 Products will display the top 10 Products for all time, repeated for each year,
    as shown in the following example:
    SELECT
    {[Measures].[Internet Sales Amount]}
    ON 0,
    [Date].[Calendar Year].[Calendar Year].MEMBERS
    TOPCOUNT(
    [Product].[Product].[Product].MEMBERS
    ,10, [Measures].[Internet Sales Amount])
    ON 1
    FROM [Adventure Works]
    ---------------------------------copy/paste end
    I hope that helps!
    Christian Wade
    http://christianwade.wordpress.com/
    Please mark correct responses as answers!

  • How should get last month value from report?

    Hi experts,
    How should last month value. For example
    jan    feb    march
    100   --       ---
    Here i want to get jan month value in march coloumn.

    Hi ,
    It is only show last month value. but my requirement is if last month is empty it should bring Before Last month.
    For Example
      Jan       Feb       Mar
    1000   
    i need if the Feb value is empty should come jan month value.

  • 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

  • HT201269 ibook stopped transferring images via image capture. last month it worked. i hav an old ibook and i cannot update to newest itunes. which is fine. however, i need the image capture to take photos off my iphone 5. no, i dont want to use i cloud.

    ibook stopped transferring images via image capture. last month it worked. i hav an old ibook and i cannot update to newest itunes. which is fine. however, i need the image capture to take photos off my iphone 5. no, i dont want to use i cloud. i would actually like to just plug it in to the usb drive the old fashioned way

    I don't believe the iOS7 update was the cause for your issue. I have three devices all updated and they all show the Import To drop menu in Image Capture as shown below.

  • Urgent: Formular question: get first/last month value with qty value

    We've got a query result as the following:
    Jan_2007 -- Feb_2007 -- Mar_2007 -- Apr_2007
    0 --- 54 --- 0 --- 3
    23 ---0 --- 12 --- 7
    In the above query result,
    1st row shows the sales quantity in Jan_2007 is 0, in Feb_2007 is 54, in Mar_2007 is 0, and in Apr_2007 is 3.
    2nd row shows the sales quantity in Jan_2007 is 23, in Feb_2007 is 0, in Mar_2007 is 12, and in Apr_2007 is 7.
    We would like to add a new column to get the first/last month value with quantity, e.g., in 1st row, the 1st month value with quantity value (>0) is Feb_2007, and the last month value with quantity value (>0) is Apr_2007. Therefore the 1st month value with qty is Feb_2007 and the last month value with qty is Apr_2007. In 2nd row, the first month value with qty is Jan_2007 and the last month value with qty is Apr_2007. But how to use formular to get the 1st/last month values with qty?
    We will give you reward points!

    Hello Kevin,  
    You can create forumula using [Boolean Operator|http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm]
    IF<Logic Expression> THEN <Expression1> ELSE <Expression2> can also be made using a formula in the form
    You can also use the [AND, OR Logical operators |http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm]to check all the keyfigure columns.
    Thanks
    Chandran

  • I am unable to sync my old Itunes library to the IMac I purchased last month, I tunes wants to erase the old library except for the ITunes I have purchased. Any ideas  out there?

      I am unable to sync my old Itunes library to the IMac I purchased last month, I tunes wants to erase the old library except for the ITunes I have purchased. Any ideas  out there?

    - You can only syncewith one iTunes library.  It sounds like you change libraries such as changing the computer.
    - As you may know you can transfer iTunes' pruchases to a new computer by:
    iTunes Store: Transferring purchases from your iPhone, iPad, or iPod to a computer
    - This previous discussion provide info on how to move other music from an iPod to a computer:
    Best iPod to PC
    - You can also manage music with different computers by:
    Using iPhone, iPad, or iPod with multiple computers
    - If you need more help please provide more information.

  • I bought my ipod touch 4g 16gb last month, it came with ios 6..now that the ios 7 has been announced, i wanted to know if i can install it on my ipod?

    I bought my ipod touch 4g 16gb last month, it came with ios 6..now that the ios 7 has been announced, i wanted to know if i can install it on my ipod

    iOS 7 will be compatible with:
    iPhone 4
    iPhone 4S
    iPhone 5
    iPod touch 5th generation 16GB
    iPod touch 5th generation 32GB/64GB
    iPad 2
    iPad with Retina Display
    iPad mini

  • One question I am looking for help with is, when you hit the history button I want my last fifty pages to show up instead of just fifteen. Is it possible to

    one question I am looking for help with is, when you hit the history button I want my last fifty pages to show up instead of just fifteen. Is it possible to change that setting?
    TY

    The History menu can only show that fixed maximum of 15 as that is hard coded.
    Maybe this extension helps:
    *History Submenus Ⅱ: https://addons.mozilla.org/firefox/addon/history-submenus-2/

  • Transformation routine to get last month value

    Hi experts,
    I am trying to write a routine in a transformation to get last months value from another dso.
    Here is my code:
    Data:
    zamnt type F,
    zmonth type c length 6.
    zmonth = sy-datum+0(6).
    select sum( /BIC/ZAMNT ) into i_amnt
    from /BIC/AZDSP00700
    where CALMONTH = zmonth -1.
         RESULT = zamnt.
    I get an incorrect expression "where CALMONTH = zmonth -1." because it does not understand "-1"
    Can anyone help me?

    Hi Odd Hilt,
    Please confirm CALMONTH format is yyyymm or something different.
    If CALMONTH format is yyyymm.
    try following code
    zmonth = sy-datum+0(6).
    ZMONTH1 = ZMONTH - 1.
    select sum( /BIC/ZAMNT ) into i_amnt
    from /BIC/AZDSP00700
    where CALMONTH = zmonth1.
    RESULT = zamnt.
    Thanks,
    Chandra

  • Last Month value for the keyfigure in Report

    HI ALL,
    how do we get keyfigure value for the last month in the report.
    for ex:  for  amount keyfigure should come for the last month  rest of the key figures should come for the current month values.
    SBU |    AMOUNT (LAST MONTH VALUE) |      QTY(CURRENT MONTH) |     NETPROFIT(CURRENT MONTH)
    The above shown is ex as i required in same manner. Even i restricted with calmonth offset value -1 in keyfigure but it is not working. please help me to get solution .
    Thanks
    Pinky Reddy

    Hi Pinky,
    It is not advisable to use offset to get the previous month value.This is not effective in the case when your current month is Jan & u have to get the previous year's dec month value.It is always better to opt for Exits
    Do use the code mentioned below.
    Note:- ZCUSMFIS3 - Variable in the selection screen for entering current month
               'ZPREVPER - Variable with which the amount key figure has to be resticted.
      WHEN 'ZPREVPER'.
        IF I_STEP = 2. "after the popup
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                                  WHERE VNAM = 'ZCUSMFIS3'.              
            V_PERIOD = LOC_VAR_RANGE-LOW+4(3).
            V_FYEAR = LOC_VAR_RANGE-LOW+0(4).
            V_FVARIANT = 'B1'.
            V_FISCPERYEAR = LOC_VAR_RANGE-LOW.
            IF V_PERIOD = '001'.
              V_PERIOD = '012'.
              V_FYEAR = V_FYEAR - 1.
              CONCATENATE V_FYEAR V_PERIOD INTO V_FISCPERYEAR.
            ELSE.
              V_FISCPERYEAR = V_FISCPERYEAR - 1.
              LOC_VAR_RANGE-LOW = V_FISCPERYEAR.
            ENDIF.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW = LOC_VAR_RANGE-LOW. "YYYYMMDD - DD will indicate the no of days
            L_S_RANGE-SIGN = 'I'.
            L_S_RANGE-OPT = 'EQ'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        ENDIF.
    Hope this provides the solution for your requirement.
    Regards,
    Saswati.

Maybe you are looking for