How to design for YTD, Monthly & Last year Key figures

Hi Gurus:
Can you pls tell me how to design a data model, where a user wants to get YTD, Monthly & Last year Key figures say Sales volume...
Is aggregates the answer?
Pls let me know...Thanks a lot

Hi Vijay,
I am a beginner in BI field.
I have a problem till now i couldnt get the right answer.
That the reason why i write you today.
My Problem is with a Query.
I'm designed a dynamic query which should look like this:
12.2005-- Jan06 --- Feb06 --- Mar06 --- Apr06 ... Dec06 --- YTD
My Problem, if you give per e.g Dezember, all Months have to appear. Or you give may, your going to receive till may.The result i receive till now its only the month i gave.How can i get the correct answer? How i am going to calculate the YTD?
You can directly answer hier:[email protected]
Thanks

Similar Messages

  • How to append DATA_PACKAGE strucutre to include new key figures?

    Hi,
    Iu2019m a newbie to ABAP and need some help with a start routine in BW 3.5
    In the source DSO I only have  the u201CYTD amountu201D key figure. The destination DSO should also contain the key figures u201CCurrent month amountu201D (ZAMTMO) and u201CLast 12months amountu201D (ZAMTLTM). So in the transfer rule I want to have a start routine to do some calculations and add the 2 new key figures.
    I use an internal table LCYEARDATA do the calculations:
      DATA: LCYEARDATA type sorted table of /bic/aZHYP3_O00
            with unique key CALMONTH /BIC/ZHYP_ACC /BIC/ZHYP_ENTI
            /BIC/ZHYP_SUBA /BIC/ZHYP_VERS
            with header line.
    IF DATA_PACKAGE IS NOT INITIAL.
       LOOP AT DATA_PACKAGE.
    *Get the YTD This Month.
        READ TABLE LCYEARDATA
            WITH KEY
              CALMONTH = DATA_PACKAGE-CALMONTH
              /BIC/ZHYP_ACC = DATA_PACKAGE-/BIC/ZHYP_ACC
              /BIC/ZHYP_ENTI = DATA_PACKAGE-/BIC/ZHYP_ENTI
              /BIC/ZHYP_SUBA = DATA_PACKAGE-/BIC/ZHYP_SUBA
              /BIC/ZHYP_VERS = DATA_PACKAGE-/BIC/ZHYP_VERS.
          IF sy-subrc IS INITIAL.
              YTDTHISMONTH  = LCYEARDATA-AMOUNT.
    ENDIF.
    *Last 12 Months = (YTD Last Year - YTD Month Last Year) + YTD This Month
        LAST12MONTH = YTDLASTYEAR - YTDMONTHLASTYEAR + YTDTHISMONTH.
    *Save MONTHLYVALUE and LAST12MONTH to the DATA_PACKAGE.
         DATA_PACKAGE-ZAMTMO = MONTHLYVALUE.
         DATA_PACKAGE-ZAMTLTM = LAST12MONTH.
         modify DATA_PACKAGE.
        ENDLOOP.
    ENDIF.
    Since the DATA_PACKAGE have the same structure as the source DSO, and donu2019t contain the new key figures, I canu2019t add the new calculated key figures at the end of the loop. I get an error message saying that ZAMTMO and ZAMTLTM canu2019t be found.
    So the basic question is: How do I append the structure of the Data Package so it can include the new key figures?
    Best,
    Johan

    Hi Karsten,
      Similar post... have a look...
    Re: data package error
    DATA: varighed TYPE i.
    wa_temp type DATA_PACKAGE_STRUCTURE OCCURS 0
    WITH HEADER LINE.
    LOOP AT DATA_PACKAGE into wa_temp.
    varighed = 100.(<b>What this means....?? condition..?</b>)
    wa_temp-/bic/iotvarig = varighed.
    wa_temp-/BIC/IOTOBJFOR = 'TEST'.
    -->> <b>you have to write modify wa_temp</b>.
    modify wa_temp.
    ENDLOOP.
    REFRESH DATA_PACKAGE.
    LOOP AT wa_temp.
    APPEND wa_temp TO DATA_PACKAGE.
    ENDLOOP.
    Hope it Helps
    Srini

  • Parameter for Last Week, Last Month & Last Year from the current Date

    I have a crystal report that has a StartDate & EndDate parameters from the stored procedure that I am calling. Now i got a new requirement saying that my user wants a drop-down parameter in which they need to be able to select last week (Sunday to Saturday), last month, last year instead of manually selecting start date and end date parameters? Can anyone please explain me how to do this?
    (FYI, I am using Crystal 2008)

    Hi Naveen,
    You'll need to handle the logic in the Stored Proc's where clause.
    If you're using oracle, I have something like this in the Stored Proc's where clause for our reports:
    Where {Date_Field} Between
    Decode('{?Relative Date}',
    'Yesterday', sysdate - 1,
    'Last Week', Tunc(sysdate, 'IW')-7)
    AND
    Decode('{?Relative Date}',
    'Yesterday', sysdate,
    'Last Week', Tunc(sysdate, 'IW'))
    where 'Relative Date' is a prompt in the Stored Proc and 'yesterday'. 'last week' are the 'static values' in the prompt.
    -Abhilash

  • Sales report for current month and year a go month

    i could you please guide me builting report for current monthwise for current month and year a ago month
    report parameter month_year='06-2010'
    tables = sales and below are the table fields
    customer_id
    invoice_dt
    invoice_am
    thanks
    nhm

    Okay, Still you did not mention how you will pass value in report while generating.
    Anyway the query with UNION ALL will work. For Example.
    I am assuming that the parameter for date/month you will pass in range like 01-JUN-2010 to 30-JUN-2010
    SELECT customer_id, SUM(curr_value) curr_value, SUM(past_value) past_value
    FROM
    SELECT customer_id, NVL(SUM(invoice_amount),0) curr_value, 0 past_value
    FROM sales
    WHERE invoice_dt BETWEEN :P_FROM_DATE AND :P_TO_DATE  -- here P_FROM_DATE and P_TO_DATE will be the date range for current year as i showed above.
    AND  -- Any Condition goes here...
    GROUP BY customer_id
    UNION ALL
    SELECT customer_id, 0, NVL(SUM(invoice_amount),0)
    FROM sales
    WHERE invoice_dt BETWEEN ADD_MONTHS(:P_FROM_DATE,-12) AND ADD_MONTHS(:P_TO_DATE,-12) -- This add_months function for the previous year same month.
    AND -- Any condition goes here...
    GROUP BY customer_id
    GROUP BY customer_idNow using the above query you can design the tabular report as you showed the format.
    -Ammad
    Edited by: Ammad Ahmed on Jul 3, 2010 7:55 PM
    added GROUP BY

  • Problem with bex query listing sales "this month" and "same month last year

    Hi,
    I've created a query in BW BEx, where I have a mandatory variable for 0calmonth, and I list 0material and sales (in volume, liter). And I have a restricted key figure giving me sales (volume in liter) restricted with 0calmonth = variable - 12, to give me the sale for the same month the user select, previous year.
    This seems to be working, the sum is correct, but when adding up the number for the sales in the month previous year, the numbers does not fit the sum in the end.
    I think the report only lists materials with sales the month selected in the variable, if a material has not been sold that month, but in the same month last year, it's not listed in the reports, but it's added in the sum in the end.
    Example.
    We have three records like this:
    material - calmonth - volume
    101 - 01.2010 - 5
    101 - 01.2011 - 8
    201 - 01.2010 - 7
    The report will give the following (calmonth variable = 01.2011)
    Material - volume this month - volume same month last year
    101 - 8 - 5
    Sum 8 - 12
    Any way to solve this issue? We noticed because we run BO - Webi on top of the BEx query, and BO sum's the values per material, and in webi the report would give us the sum 8 and 5.
    Any input is appreciated.
    Regards,
    Øystein

    Hi,
    thanks for your reply.
    The error is that the report only seems to list materials that has been sold "this month", and if the same material was sold the same month last year, it will also list the volume for this.
    But if the material is only sold in the same month last year, it's not listed in the report, but it's calculated into the sum at the end.
    The report is listing material, which is why the error presents itself, as you said
    Getting 8 minus 12 is correct unless you drill down by material. In that case, it should be 8 minus 5 and 0 minus 7.
    The row with 0 - 7 is not shown, and my guess is that the report will only list materials that has sales this month (which has been selected in the variable)
    Regards,
    Øystein
    Edited by: Oystein Gundersen on Mar 21, 2011 4:36 PM

  • ABAP Logic - This Month This Year to This Month Last Year problem

    Hi All,
    I have a following requirement ... the report currently compares This Month This Year to This Month Last Year. But this is not a valid comparison for the user until the end of the month is reached as only then is it comparing 2 full months. We would like to use a formula replacement path variable to work out which proportion of data we have for this month. ie. if its day 15, we have 50% of data (if there are 30 days in the month - this just an example), therefore we should only show 50% of This Month Last Years column so that the comparison between the 2 is sensical.
    So I'd like the formula variable to return a ratio or percentage which I can then use in a calculated key figure in the query to pro-rata the last year data.
    The query currently displays data by Fiscal Period, so when working out the ratio I would need to check which Fiscal Period we're in and also consider that the data is loaded every night, so on the 1st day of a Fiscal Period we are comparing everything up until yesterday.
    Can anyone see in problem with the logic of this, or better yet, has anyone done this before and maybe has some code for me? Is there another way I could be doing this?
    Edited by: Julius Bussche on Sep 19, 2008 4:31 PM

    Have you tried google for this Error Message...
    http://support.microsoft.com/kb/959077

  • How to make data sorted by default by key figure?

    hi experts,
    how to make data sorted by default by key figure?

    Hi ,
    Try to make the selections for the filter of the query..
    Check this link ..
    http://help.sap.com/saphelp_nw70/helpdata/en/f1/0a5625e09411d2acb90000e829fbfe/frameset.htm
    Regards,
    Shikha

  • HOW TO COPY BUISNESS CONTENT SOME  CHARACTERSTICS   AND KEY FIGURE I WANT

    HOW TO COPY BUISNESS CONTENT SOME  CHARACTERSTICS   AND KEY FIGURE I WANT TO LOAD MY  INFOCUBE  PLEASE GIVE DETAILS SCREENSHOTS

    HI,
    Go through this url
    [http://help.sap.com/saphelp_nw70/helpdata/EN/80/1a66d5e07211d2acb80000e829fbfe/content.htm]
    Regards,
    Rajkandula

  • How to calculate YTD and Last year YTD on Date in Bex

    Hi,
    I have a requirement in which I need to show the report as following format.
    I need to show    Year>monthday as Hierarchy. user will drill down on Month to Date.
                 Del Qty              Ord Qty              Del  Qty LY              Del Qty YTD                  Del Qty  L YTD
    Year
    > Drill Down to Months
            Jan
            Feb
            Mar
              ---> 1.03.2010
              ---> 2.03.2010
              ---> 3.03.2010
            Dec
    I have Calday, Calmonth, Calyear all three objects.
    Now my question is how I can achive this? On which i need to create hierarchy?
    and how to calculate the YTD at day level.
    Note:- in the selection calyear is mandatory. User wants to display as per year.   So What infoobject I need to take in selection?
    and the way to calculate YTD on Day (in the case also ,where user doesn't give the date in selection)
    Plz reply asap its uregent !!!
    Thanks in advance,
    Amit

    Hi,
    As per my understanding I think YTD means JAN to current date result. I means say if user enter 062005 then result in YTD should be from 012005 to 062005.
    And to do this you need to write a customer exit variable where LOW field of internal table you will put JAN year and HIGH will contain month year entered by user.
    Hope this will help you.
    Suneel

  • How to get Current month last year sale in report

    HI,
              I would like to compare the sale value of a  month for any year.
    ie sale of the march month for this year ,previous year and a year before ..like that
    at least for two years..ie current and prvious year.
    how can i get it done in query?
    thnx

    Create three restricted key figures.
    In one restrict month by current month.
    In other use offset of -12 and -24 while restricting current month.

  • How can i get the month and year of the current  open Periode?

    At the beginning of each month the booking period for the new month was not open,but i need to book material automatically with the last day of the old month. The booking period will change at the first working day between 13 and 17 a clock. when the booking period was changed i have to book with the current date.
    How can i do this ??
    Regards
    Ralf

    Hi Ralf,
    here's a complete example:
    DATA: last LIKE sy-datum, "ultimo of last month
          gjahr LIKE t001b-frye1,
          buper LIKE t001b-frpe1.
    last = sy-datum - sy-datum+6(2) .
    PERFORM check_period.
    IF sy-subrc <> 0.
      ADD 1 TO last . "-> next month
      PERFORM check_period.
      IF sy-subrc <> 0.
        MESSAGE a001(00) WITH 'no open fi period'.
      ENDIF.
    ENDIF.
    *formatting for germany
    CONCATENATE last+6(2) last+4(2) last(4) INTO bbkpf-budat.
    WRITE: / bbkpf-budat.
    FORM check_period.
      MOVE last(4) TO gjahr.
      MOVE last+4(2) TO buper.
      CALL FUNCTION 'FI_PERIOD_CHECK'
           EXPORTING
                i_bukrs          = bbkpf-bukrs
                i_gjahr          = gjahr
                i_koart          = '+'
                i_monat          = buper
           EXCEPTIONS
                error_period     = 1
                error_period_acc = 2
                OTHERS           = 3.
    ENDFORM.                    " check_period
    regards <a href="https://www.sdn.sap.com:443/irj/servlet/prt/porta
    l/prtroot/com.sap.sdn.businesscard.SDNBusinessCard?u=i
    Wo3ssHlIihvCrADIEGqaw%3D%3D">Andreas</a>
    Message was edited by: Andreas Mann

  • Function module for getting month and year of the previous month (say -6)

    Hi,
    Is there a function module that will get you the month and year of say, a month before, and as far as 11 months ago.
    For example, say today is 6/2007. I want 7 months ago.
    How do i get this value?
    What function module or method is available?
    Points will be rewarded and responses will be appreciated.
    Thank You,
    John

    Hi
    lv_period gives the month and year which is two months earlier now as we have specified lv_months as -2.
        DATA: LV_PERIOD LIKE S001-SPMON,
              LV_MONTHS(2) TYPE C VALUE '2-',
              LV_DATUM LIKE SY-DATUM,
              LV_NEWDT LIKE SY-DATUM,
            P_SPMON LIKE S001-SPMON VALUE '200601'.
        CONCATENATE P_SPMON '01' INTO LV_DATUM.
        LV_PERIOD = P_SPMON+0(6).
        CALL FUNCTION 'MONTH_PLUS_DETERMINE'
             EXPORTING
                  MONTHS  = LV_MONTHS
                  OLDDATE = LV_DATUM
            IMPORTING
                 NEWDATE = LV_NEWDT
             EXCEPTIONS
                  OTHERS  = 1.
         IF SY-SUBRC = 0.
           LV_PERIOD = LV_NEWDT+0(6).
         ENDIF.
    WRITE :/ LV_PERIOD.
    OR
    Use the following FM for getting the year and the month based on date
    CACS_DATE_GET_YEAR_MONTH
    or
    Call Function 'CCM_GO_BACK_MONTHS '.
    Funny module: 03/31/2002 - 1 month = 02/31/2002
    OR
    RE_ADD_MONTH_TO_DATE ( Add / substract month to/from date )
    Need ur reward points.
    Best regards,
    Ravi

  • Table for Material Quantity and Value for particular month and year

    Hi All
    My requirement is that for a particular month and year I want to know the stock quantity and stock value for a particular material for a given plant.From which SAP table can I get this data as I want to fetch data for my Y report?
    Regards
    Satish Kumar

    Hi,
    You can use MB5B table as suggested earlier.also you can use:
    MBEW-VMKUM --> stock for previous month period
    MBEW-VJKUM --> stock for previous year period
    PLease view these links which migh tbe helpful to you:
    http://help.sap.com/saphelp_47x200/helpdata/en/39/55fee3bc6111d4b3960050dadf0791/content.htm
    TableStock
    Thanks
    Nisha

  • How to do "for each month in 2008 sum amount where category is cash"

    The table format is:
    Date(MM/DD/YYYY) Amount Description Category Account
    01.02.2008 -21000 benzina (C) Calatorii Cash
    01.04.2008 -2000 Mancare (C) Calatorii Cash
    01.05.2008 -2000 Mancare (C) Comisioane Cash
    05.12.2008 4706 diverse (C) Comisioane BT - Mondo
    08/25/2008 8807 diverse (C) Calatorii BRD - PFA
    08/25/2008 104000 diverse (C) Comisioane BRD - Multiplan
    10.10.2008 6385849 diverse (C) Comisioane BRD - Atucont
    10/26/2008 943699 diverse (C) Calatorii BRD - ISIC
    10/27/2008 95313 diverse (C) Comisioane Cash
    10/28/2008 -300 Comisioane (C) Comisioane BRD - ISIC
    I am trying to do the following:
    for each month in 2008
    sum (Amount) where Category is (C) Calatorii
    =>
    January -23000
    February 0
    for each month in 2009 up until now
    sum (Amount) where Category is Cash
    =>
    January 35000
    With these 2 samples I can manage the other functions I need.
    Thanks in advance.

    Question asked and responded several times.
    In column H of the first table I inserted the formula:
    =YEAR(B)*100+MONTH(B)
    In column B of the second table, the formula is:
    =SUMIFS(Tableau 1 :: C,Tableau 1 :: G,"=Cash",Tableau 1 :: H,"="&A)
    CAUTION
    I don't know your system settings.
    If your system uses the decimal comma, you will have to use:
    =SUMIFS(Tableau 1 :: C;Tableau 1 :: G;"=Cash";Tableau 1 :: H;"="&A)
    Yvan KOENIG (from FRANCE jeudi 23 avril 2009 15:04:49)

  • How can i know the month and year when my ipod classic was manufactured ?

    assuming i only have its serial no.

    Hi Ralf,
    here's a complete example:
    DATA: last LIKE sy-datum, "ultimo of last month
          gjahr LIKE t001b-frye1,
          buper LIKE t001b-frpe1.
    last = sy-datum - sy-datum+6(2) .
    PERFORM check_period.
    IF sy-subrc <> 0.
      ADD 1 TO last . "-> next month
      PERFORM check_period.
      IF sy-subrc <> 0.
        MESSAGE a001(00) WITH 'no open fi period'.
      ENDIF.
    ENDIF.
    *formatting for germany
    CONCATENATE last+6(2) last+4(2) last(4) INTO bbkpf-budat.
    WRITE: / bbkpf-budat.
    FORM check_period.
      MOVE last(4) TO gjahr.
      MOVE last+4(2) TO buper.
      CALL FUNCTION 'FI_PERIOD_CHECK'
           EXPORTING
                i_bukrs          = bbkpf-bukrs
                i_gjahr          = gjahr
                i_koart          = '+'
                i_monat          = buper
           EXCEPTIONS
                error_period     = 1
                error_period_acc = 2
                OTHERS           = 3.
    ENDFORM.                    " check_period
    regards <a href="https://www.sdn.sap.com:443/irj/servlet/prt/porta
    l/prtroot/com.sap.sdn.businesscard.SDNBusinessCard?u=i
    Wo3ssHlIihvCrADIEGqaw%3D%3D">Andreas</a>
    Message was edited by: Andreas Mann

Maybe you are looking for

  • Use of JavaScript in Adobe Forms

    Hi guru's... Are there any restrictions in the use of JavaScript Coding within Livecycle Designer? Which objects, methods and/or functions can be used and which can't? Is there a reference guide for this? And is there a way to use some kind of debugg

  • SRM PO profit center addition

    Hi All; We have extended classic scenario in our project. So approved & complete shopping carts are automatically converted into PO. Now the client is asking to add profit center for certain type of indirect expenses as they have to be assigned to a

  • Javascript on report load

    Hi to all, i have a problem with a prompt. I need to launch a Javascript at the same time a report load. In practice this javascript function must reset my selection in the prompt linked to this report. Thanks for replies. p.s.:I hope i was clear,sor

  • Dyslexic colour changes

    Hi i was just wondering how i can change the back ground colour of my page in Pages. i have dyslexia and really need a light yellow background to help me read better but don't seem to be able to find how to do it ???? any answers thanks Ben

  • Highlight Multiple Rows in a Report

    Hello all, I'm trying to implement a highlight as seen here, http://www.netlobo.com/javascript_background_color_toggle.html function toggleBgColor(elem) var style2 = elem.style; style2.backgroundColor = style2.backgroundColor? "":"#FFFF00"; I have th