Calculation of ''Total to Date'' like ''Year to date''

Hello together,
How would you calculate a Total to Date in Oracle BI.
It should sum all values like Year to date up to a certain period inclusive all previous years.
Example:
Year Value
2008 10
2009 20
2010 40
If I select 2009 it shoul display 30. without the previous and the following row.
Regards,
Stefan
Content Level Fiscal Period TOTAL (Do I have to calculate on a yearly level all the past years, - ago - 1, ago -2, ago - 3, ago - 4 up to - 20?)
minus Year Value
plus YTD
Month and Total have to bes diplayed in on line.
works for the current year but not when you back to last year.
Edited by: stefanhess on Jun 14, 2010 1:54 PM

an odd solution.
In the physical layer you can duplicate the fact table and can join the time dim and duplicated fact with the complex join using the year column with the condition as
time_dimension.year_column >= fact_table.year_column
in your report when you bring the year and this measure you will get what you want.
Edited by: kart on Jun 14, 2010 6:46 PM

Similar Messages

  • Month to Date and Year to Date Scenarios

    <b>Dear SAP BI Gurus,
    Can anyone please give me guidance how to create a Month to Date and Year To Date Scenarios (Variables perhaps?) for 0SRR_CF_C1?  The date is in decimal and not DATE format…  I’m assuming the reason for this is to get the Time variance….  Nonetheless, I’d like to create a MTD and YTD scenario for reporting.
    Much Thanks
    Philips Manalaysay</b>

    Hi,
    You should take a look at the blog and doc below.
    /people/vikash.agrawal/blog/2006/10/17/enable-trend-reporting-150-by-manipulating-variable-value
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
    Regards,

  • Month to Date and Year to date calculation

    Hello Experts,
    It would be great If you could provide the formula to implement in BO universe or in the Reporting level for the below requirement.
    MTD, LastMonth, Year to Date, Last to LastMonth and examples are below.
    Last Week:
    Eg: Monday through Sunday
    Description: Based on Todayu2019s date, select the Monday of the previous week for the start date and Sunday will be the end date.
    Example:
    If Today is May 22, 2009
    The result would be, Monday = May 11, 2009, Sunday = May 17, 2009
    MTD:
    If Today is May 22, 2009
    I need a result MTD = May 1, 2009 u2013 May 21, 2009
    LastMonth:
    If Today is May 22, 2009
    I need a result LastMaont = April 1, 2009 u2013 April 30, 2009
    Last to LastMonth:
    If Today is May 22, 2009
    I need a result LastMaont = March 1, 2009 u2013 March 31, 2009
    Thank you.

    Nisniki,
    Here are the methods using WebI:
    MTD: 
    Create a local variable "MTD Start"
    =RelativeDate(LastDayOfMonth(RelativeDate(CurrentDate();-30));1)
    Create a local variable "MTD End"
    =currentdate()
    LastMonth
    =LastDayOfMonth(RelativeDate(CurrentDate();-30))
    Year to Date
    create a local variable "YTD Begin"
    =ToDate("01/01/"+FormatNumber(Year(CurrentDate());"####");"mm/dd/yyyy")
    (reuse "MTD End" or build a "YTD End" variable same as "MTD End")
    Last to LastMonth
    (similiar to MTD, but using "60" versus "30" to move back two months versus moving back 1 month.
    To perform this stuff in the universe requires an understanding of the SQL syntax for the paricular vendor your are working with.  ANSI SQL agrees to represent and compute dates uniformly, however, the functions to make it happen varies by the vendor.
    Thanks,
    John

  • This year master data-previous year transaction data load

    hi guys,
    I support some infocubes where financial data is stored and reported on.our source systems are financial databases.
    now we load transaction data every month-end throughout a year.we load master data(full load) from flatfiles whenever there are changes.whenever we change master data,we include these changes in transaction data infopackage selections,so the transaction data related to new master data will also be loaded.
    now my situation is:
    Now this is June,2010.My boss said I have to reload transaction data for 2009 as there was some changes in rates on which the data was calulated in 2009.Some new rates came in,so they re-calculated 2009 transaction data and sent it to us.Now we have to reload this 2009 data and delete OLD 2009 data from cubes.
    My question---As I am going to re-load 2009 transaction data...but the master data present in system is up-to-date..i.e, June 2010..(its not the same master data of 2009....there were few additions and renamings until today.)...so what do we need to do in this type of situations?
    Also,as I said above,whenever we have changes in master data,we change transaction data infopackage selections so they load transaction data related to this new master data also...so it means Infopackage selections of today donot reflect the infopackage selections of 2009....but we are still trying to reload 2009 transaction data with todays infopackage??
    How do we need to do in these type of situations?Do we just go ahead and load 2009 data with 2010 master data and 2010 infopackage selections........?
    Thanks alot for your patience....
    Rgds.

    we are actually having time-dependent master data....one version of master data for each year ...like for 2005..we have verion 2....for 2006..we have version 3....master data version and to which year they are linked to is maintained in a customised table....
    so coming back to my previous post...
    for 2009...we have version 4....and transaction data was loaded then.....
    for 2010..we have version 5...and transaction data will be loaded at the end of every month...and also we have decided to reload 2009 data because the the rates on which 2009 data was calculated,changed and so our business recalculated that data and sent to us and we have to reload 2009 data and delete OLD 2009 data....
    now my questions...if we re-load 2009 data,today master data is of 2010(version 5)....this is meant for 2010 transaction data loadings....Doesnt it create inconsistencies....or am I thinking too much...is just to go ahead and load....?
    Also the infopackage selections today donot match with infopackage selections of 2009 as there were additions in master data and so we included in selections....Do we need to change back the infopackage selections to 2009 until 2009 re-load is over?
    Hope I explained it better...............
    Thanks alot.

  • Month-to-Date and Year-to-Date values in Query

    Hello experts,
    One of our BI reports has the following requirement: the user should be asked for the report date. After the user inputs the date, the report shows the key figures in three different "flavors": one is the values for that date, the second one is the cumulate values from the first day of the month of the report date to the report date itself, and the third is the cumulate values from the first day of the year of the report date to the report date itself.
      I created my report date variable based on 0CALDAY. Then I searched for SAP-exit variables that would help me achieve this, but could not really find any, except for 0P_ABO10, 0P_ABO11, 0P_ABO12 variables, all of them have as description "Start of Key Date Year". I tried creating a few selections in which the dates taken were defined as a range from each of these variables to the report date variable (for the year-to-date values), but I got the error "Variable 0P_ABO10 could not be substituted". I also got this error for the other two variables. And I could not find any SAP-exit variables like "Start of Key Date Month", in order to do the Month-to-Date part. My next try was to use the field "Key Date" with a variable in it, instead my own report date variable based on 0CALDAY, but it gave me the same errors.
    I searched the forums and found a few threads that looked useful, like
    First and Last day of month and
    1st day of month / 1st day of week variables
    However, they require some ABAP coding, and I do not know where to place the code (actually, I do not know where to work with ABAP code), and I also believe that I would have to do some changes to it.
    Any suggestions?

    Hi Pedro,
    You have to create customer exit in T_Code: CMOD
    1. Create a Z project
    2. Select RSR00001 as enhancement type.
    3. Go into include ZXRSRU01
    4. create a code like
    Here A is your variable based on 0calmonth with type customer exit and B is variable for 0calday.
    Try to write logic for your case taking this as example.
    WHEN 'A'.
        IF I_Step = 2.
          Loop at I_T_VAR_RANGE into L_T_VAR_RANGE where VNAM = 'B'.
            Concatenate L_T_VAR_RANGE-LOW(4) '001' into D1.
            Concatenate L_T_VAR_RANGE-LOW(4) '012' into D2.
            Clear L_S_Range.
            L_S_Range-low = D1.
            L_S_RANGE-high = D2.
            L_S_RANGE-sign = 'I'.
            L_S_RANGE-opt = 'BT'.
            Append L_S_Range to E_T_Range.
          ENDLOOP.
        ENDIF.
    If you want exact code I can help you in that.
    Thanks,
    Kams

  • Calculating the total in alv and displaying the date

    Hi,
    I am trying to calculate the totals of netwr and fkimg in a report but the following coding cannot giv me the right answer so if there is anyone with the solution for this problem may you please help me out and how can i display the date on my report......here is my coding:
    REPORT  Z_DAILY_STOCK_NEW.
    TYPE-POOLS: SLIS.
                       TABLES
    TABLES: vbrk, kna1,vbrp,vbap,vbak, sflight.
               ALV FIELDS
    DATA: it_fieldcat TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          wa_fieldcat TYPE slis_fieldcat_alv.
    DATA: w_cnt LIKE sy-tabix.
         total ref to data.
        t_alv LIKE TABLE OF s_error WITH HEADER LINE.
    DATA: gr_layout TYPE slis_layout_alv,
          gr_tab_group TYPE slis_t_sp_group_alv,
          gr_repid LIKE sy-repid,
          gr_events TYPE slis_t_event,
          gr_print  TYPE slis_print_alv,
          gr_user   TYPE slis_formname VALUE 'USER_COMMAND'.
             SELECTION SCREEN
    SELECT-OPTIONS:
      s_werks FOR vbrp-werks,
      s_auart FOR vbak-auart.
             DEFINITION OF AN INTERNAL TABLE
    DATA: begin of i_stocktab occurs 0,
             kunag LIKE vbrk-kunag,
             name1 LIKE kna1-name1,
             ort01 LIKE kna1-ort01,
             inco1 LIKE vbrk-inco1,
             vkgrp LIKE vbrp-vkgrp,
             fkimg LIKE vbrp-fkimg,
             netwr LIKE vbrk-netwr,
          end of i_stocktab.
             START OF SELECTION
       SELECT vbrkkunag kna1name1 kna1ort01 vbrkinco1 vbrp~vkgrp
              vbrpfkimg vbrknetwr
              FROM kna1 inner join vbrk on kna1kunnr EQ vbrkkunrg
                        inner join vbak on kna1kunnr EQ vbakkunnr
                        inner join vbrp on vbrkvbeln EQ vbrpvbeln
              INTO i_stocktab
              WHERE vbrp~werks IN s_werks
              AND   vbak~auart IN s_auart.
              APPEND i_stocktab.
       ENDSELECT.
    *DATA tb_alv TYPE i_stocktab WITH HEADER LINE.
    PERFORM build_fieldcatalog.
    PERFORM build_layout.
    PERFORM build_event.
    PERFORM build_print.
    PERFORM calc_total.
    PERFORM display_alv_report.
    FORM build_fieldcatalog.
      w_cnt = 1.
      it_fieldcat-fieldname = 'KUNAG'.
      it_fieldcat-seltext_m = 'Soldtp'.
      it_fieldcat-col_pos   = w_cnt.
      it_fieldcat-emphasize = 'X'.
      it_fieldcat-key       = 'X'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
      w_cnt = w_cnt + 1.
      it_fieldcat-fieldname = 'NAME1'.
      it_fieldcat-seltext_m = 'Name'.
      it_fieldcat-col_pos   = w_cnt.
      it_fieldcat-emphasize = 'X'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
      w_cnt = w_cnt + 1.
      it_fieldcat-fieldname = 'ORT01'.
      it_fieldcat-seltext_m = 'City'.
      it_fieldcat-col_pos   = w_cnt.
      it_fieldcat-emphasize = 'X'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
      w_cnt = w_cnt + 1.
      it_fieldcat-fieldname = 'INC01'.
      it_fieldcat-seltext_m = 'Incoterms'.
      it_fieldcat-col_pos   = w_cnt.
      it_fieldcat-emphasize = 'X'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
      w_cnt = w_cnt + 1.
      it_fieldcat-fieldname = 'VKGRP'.
      it_fieldcat-seltext_m = 'Sales Group'.
      it_fieldcat-col_pos   = w_cnt.
      it_fieldcat-emphasize = 'X'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
      w_cnt = w_cnt + 1.
      it_fieldcat-fieldname = 'FKIMG'.
      it_fieldcat-seltext_m = 'Invoiced Qty'.
      it_fieldcat-col_pos   = w_cnt.
      it_fieldcat-emphasize = 'X'.
    *it_fieldcat-do_sum = 'x'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
      w_cnt = w_cnt + 1.
      it_fieldcat-fieldname = 'NETWR'.
      it_fieldcat-seltext_m = 'Invoiced Value'.
      it_fieldcat-col_pos   = w_cnt.
      it_fieldcat-emphasize = 'X'.
    it_fieldcat-do_sum    = 'x'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
    ENDFORM.
    FORM build_layout.
        gr_layout-no_input           = 'X'.
        gr_layout-colwidth_optimize  = 'X'.
        gr_layout-totals_text        = 'Totals: '(201).
        gr_layout-detail_popup       = 'X'.
    ENDFORM.
    FORM build_event.
      DATA i_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
         EXPORTING
           i_list_type = 0
         IMPORTING
           et_events   = gr_events[].
       READ TABLE gr_events WITH KEY name = slis_ev_user_command
                            INTO i_event.
       if sy-subrc = 0.
         MOVE gr_user TO i_event-form.
         APPEND i_event TO gr_events.
       endif.
    ENDFORM.
    *FORM calc_total.
    LOOP AT it_fieldcat into wa_fieldcat
    WHERE fieldname EQ 'FKIMG' OR
           fieldname EQ 'NETWR'.
           wa_fieldcat-do_sum   = 'X'.
           wa_fieldcat-datatype = 'QUAT'.
    modify it_fieldcat from wa_fieldcat.
    ENDLOOP.
    *ENDFORM.
    FORM build_print.
         gr_print-reserve_lines = '2'.
         gr_print-no_coverpage  = 'X'.
    ENDFORM.
    FORM calc_total.
    DATA: total type ref to data,
          subtotal1 type ref to data.
      field-symbols <fkimg> like sflight.
      field-symbols <netwr> like sflight.
      call method grid1-> get_subtotals
         importing
            ep_collect00 = subtotal
            ep_collect01 = total.
      assign total to <fkimg>.
      assign total to <netwr>.
    ENDFORM.
    *&          FUNCTION ALV DISPLAY
    FORM display_alv_report.
    gr_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
       I_CALLBACK_PROGRAM                = gr_repid
       I_CALLBACK_USER_COMMAND           = slis_ev_user_command
       I_CALLBACK_TOP_OF_PAGE            = 'TOP-OF-PAGE' " see FORM
       IS_LAYOUT                         = gr_layout
       IT_FIELDCAT                       = it_fieldcat[]
       IT_SPECIAL_GROUPS                 = gr_tab_group
       I_SAVE                            = 'X'
       IT_EVENTS                         = gr_events
       IS_PRINT                          = gr_print
      TABLES
        t_outtab                          = i_stocktab
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2.
    IF sy-subrc <> 0.
    ENDIF.
    ENDFORM.
    FORM top-of-page.
    *ALV Header deaclarations
      DATA: t_header TYPE slis_t_listheader,
            wa_header TYPE slis_listheader,
            t_line LIKE wa_header-info,
            ld_lines TYPE i,
            ld_linesc TYPE c.
    *Title
       wa_header-typ  = 'H'.
       wa_header-info = 'Report for daily Stock Returns'.
       APPEND wa_header TO t_header.
       CLEAR wa_header.
    *Total No. Records Selected
    DESCRIBE TABLE i_stocktab LINES ld_lines.
      ld_linesc = ld_lines.
      CONCATENATE 'Total No. of Records Selected:' ld_linesc
                              INTO t_line SEPARATED BY space.
      wa_header-typ = 'A'.
      wa_header-info = t_line.
      APPEND wa_header TO t_header.
      CLEAR: wa_header, t_line.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
             it_list_commentary = t_header.
    ENDFORM.

    Try This
    REPORT z_daily_stock_new.
    TYPE-POOLS: slis.
    * TABLES
    TABLES: vbrk, kna1,vbrp,vbap,vbak, sflight.
    * ALV FIELDS
    DATA: it_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
    wa_fieldcat TYPE slis_fieldcat_alv.
    DATA: w_cnt LIKE sy-tabix.
    * total ref to data.
    * t_alv LIKE TABLE OF s_error WITH HEADER LINE.
    DATA: gr_layout TYPE slis_layout_alv,
    gr_tab_group TYPE slis_t_sp_group_alv,
    gr_repid LIKE sy-repid,
    gr_events TYPE slis_t_event,
    gr_print TYPE slis_print_alv,
    gr_user TYPE slis_formname VALUE 'USER_COMMAND'.
    * SELECTION SCREEN
    SELECT-OPTIONS:
    s_werks FOR vbrp-werks,
    s_auart FOR vbak-auart.
    * DEFINITION OF AN INTERNAL TABLE
    DATA: BEGIN OF i_stocktab OCCURS 0,
    kunag LIKE vbrk-kunag,
    name1 LIKE kna1-name1,
    ort01 LIKE kna1-ort01,
    inco1 LIKE vbrk-inco1,
    vkgrp LIKE vbrp-vkgrp,
    fkimg LIKE vbrp-fkimg,
    netwr LIKE vbrk-netwr,
    END OF i_stocktab.
    * START OF SELECTION
    SELECT vbrk~kunag kna1~name1 kna1~ort01 vbrk~inco1 vbrp~vkgrp
    vbrp~fkimg vbrk~netwr
    FROM kna1 INNER JOIN vbrk ON kna1~kunnr EQ vbrk~kunrg
    INNER JOIN vbak ON kna1~kunnr EQ vbak~kunnr
    INNER JOIN vbrp ON vbrk~vbeln EQ vbrp~vbeln
    INTO i_stocktab
    WHERE vbrp~werks IN s_werks
    AND vbak~auart IN s_auart.
      APPEND i_stocktab.
    ENDSELECT.
    *DATA tb_alv TYPE i_stocktab WITH HEADER LINE.
    PERFORM build_fieldcatalog.
    PERFORM build_layout.
    PERFORM build_event.
    PERFORM build_print.
    PERFORM calc_total.
    PERFORM display_alv_report.
    *       FORM build_fieldcatalog                                       *
    FORM build_fieldcatalog.
      w_cnt = 1.
      it_fieldcat-fieldname = 'KUNAG'.
      it_fieldcat-seltext_m = 'Soldtp'.
      it_fieldcat-emphasize = 'X'.
      it_fieldcat-key = 'X'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
      w_cnt = w_cnt + 1.
      it_fieldcat-fieldname = 'NAME1'.
      it_fieldcat-seltext_m = 'Name'.
      it_fieldcat-emphasize = 'X'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
      w_cnt = w_cnt + 1.
      it_fieldcat-fieldname = 'ORT01'.
      it_fieldcat-seltext_m = 'City'.
      it_fieldcat-col_pos = w_cnt.
      it_fieldcat-emphasize = 'X'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
    *  w_cnt = w_cnt + 1.
    *  it_fieldcat-fieldname = 'INC01'.
    *  it_fieldcat-seltext_m = 'Incoterms'.
    *  it_fieldcat-emphasize = 'X'.
    *  APPEND it_fieldcat TO it_fieldcat.
    *  CLEAR it_fieldcat.
      w_cnt = w_cnt + 1.
      it_fieldcat-fieldname = 'VKGRP'.
      it_fieldcat-seltext_m = 'Sales Group'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
      w_cnt = w_cnt + 1.
      it_fieldcat-fieldname = 'FKIMG'.
      it_fieldcat-seltext_m = 'Invoiced Qty'.
      it_fieldcat-emphasize = 'X'.
      it_fieldcat-ref_tabname  = 'VBRP' .
      it_fieldcat-ref_fieldname = 'FKIMG' .
      it_fieldcat-do_sum = 'X' .
    * *it_fieldcat-do_sum = 'x'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
      w_cnt = w_cnt + 1.
      clear it_fieldcat .
      it_fieldcat-fieldname = 'NETWR'.
      it_fieldcat-seltext_m = 'Invoiced Value'.
      it_fieldcat-emphasize = 'X'.
      it_fieldcat-ref_tabname  = 'VBRP' .
      it_fieldcat-ref_fieldname = 'NETWR' .
      it_fieldcat-do_sum = 'X' .
    * it_fieldcat-do_sum = 'x'.
      APPEND it_fieldcat TO it_fieldcat.
      CLEAR it_fieldcat.
    ENDFORM.
    *       FORM build_layout                                             *
    FORM build_layout.
      gr_layout-no_input = 'X'.
      gr_layout-colwidth_optimize = 'X'.
      gr_layout-totals_text = 'Totals: '(201).
      gr_layout-detail_popup = 'X'.
    ENDFORM.
    *       FORM build_event                                              *
    FORM build_event.
      DATA i_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type = 0
           IMPORTING
                et_events   = gr_events[].
      READ TABLE gr_events WITH KEY name = slis_ev_user_command
      INTO i_event.
      IF sy-subrc = 0.
        MOVE gr_user TO i_event-form.
        APPEND i_event TO gr_events.
      ENDIF.
    ENDFORM.
    *FORM calc_total.
    * LOOP AT it_fieldcat into wa_fieldcat
    * WHERE fieldname EQ 'FKIMG' OR
    * fieldname EQ 'NETWR'.
    * wa_fieldcat-do_sum = 'X'.
    * wa_fieldcat-datatype = 'QUAT'.
    * modify it_fieldcat from wa_fieldcat.
    * ENDLOOP.
    *ENDFORM.
    FORM build_print.
      gr_print-reserve_lines = '2'.
      gr_print-no_coverpage = 'X'.
    ENDFORM.
    *       FORM calc_total                                               *
    FORM calc_total.
      DATA: total TYPE REF TO data,
      subtotal1 TYPE REF TO data.
    *  FIELD-SYMBOLS <fkimg> LIKE sflight.
    *  FIELD-SYMBOLS <netwr> LIKE sflight.
    *  CALL METHOD grid1-> get_subtotals
    *  IMPORTING
    *  ep_collect00 = subtotal
    *  ep_collect01 = total.
    *  ASSIGN total TO <fkimg>.
    *  ASSIGN total TO <netwr>.
    ENDFORM.
    *& FUNCTION ALV DISPLAY
    FORM display_alv_report.
      gr_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = gr_repid
                i_callback_user_command = slis_ev_user_command
                i_callback_top_of_page  = 'TOP-OF-PAGE'  " see FORM
                is_layout               = gr_layout
                it_fieldcat             = it_fieldcat[]
                it_special_groups       = gr_tab_group
                i_save                  = 'X'
                it_events               = gr_events
                is_print                = gr_print
           TABLES
                t_outtab                = i_stocktab
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.
    *       FORM top-of-page                                              *
    FORM top-of-page.
    *ALV Header deaclarations
      DATA: t_header TYPE slis_t_listheader,
      wa_header TYPE slis_listheader,
      t_line LIKE wa_header-info,
      ld_lines TYPE i,
      ld_linesc TYPE c.
    *Title
      wa_header-typ = 'H'.
      wa_header-info = 'Report for daily Stock Returns'.
      APPEND wa_header TO t_header.
      CLEAR wa_header.
    *Total No. Records Selected
      DESCRIBE TABLE i_stocktab LINES ld_lines.
      ld_linesc = ld_lines.
      CONCATENATE 'Total No. of Records Selected:' ld_linesc
      INTO t_line SEPARATED BY space.
      wa_header-typ = 'A'.
      wa_header-info = t_line.
      APPEND wa_header TO t_header.
      CLEAR: wa_header, t_line.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = t_header.
    ENDFORM.

  • Any way to change/replace EXIF data like the original date of photo?

    I'm importing into Lightroom several thousand photos I took with my first digital camera, back in 2000-2004. It's all gone very smoothly. But here's my problem:
    In my old workflow, photos I spent time editing wound up as TIF files, and whatever program I used to edit them stripped out the EXIF information from them. As a result, for example, a photo which was actually taken on March 4, 2001 will have EXIF information showing it was taken on March 10, 2001, the date on which I edited it and made the TIF. All of the other EXIF data is stripped as well, the exposure data, lens information, ISO, whether the flash fired, etc. The TIF file basically seems to have no EXIF data other than the file size and my name.
    I can live without the other info, really, but the changing of the information about the original date/time means that the TIF file doesn't sort next to the original file in Lightroom, which I'd like it to do. There's not thousands of photos for which I have TIFs, just a few hundred at most.
    Is there any way, with a plug-in or some external program, to copy the EXIF information from the original program and insert it into the TIF file?

    I'd suggest just using ExifTool.
    The command is:
         exiftool -tagsFromFile {SRCFILE} {DESTFILE}
    So, if you have a tif sans exif named my.tif, and an original jpg with exif named my.jpg, it would be:
         exiftool -tagsFromFile my.jpg my.tif
    There may be a batch-y way to do this with exiftool, or you could make your own batch file to do this in bulk...
    Main link: http://www.sno.phy.queensu.ca/~phil/exiftool/
    Examples: http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html#copying_examples
    PS - To sync changes from files into catalog, use 'Read Metadata from File' function on Library Metadata menu.
    Rob

  • Quarter to date and year to date

    i need to create a formula that if the end user selects parameter  QTD, the report should retrieve all records where the effective date  is in the current quarter. having trouble with that anyone help?  The following is somewhat working, but i need to retrieve records in the currentqtr.
    if {?Date Range}='QTD' and {Sheet1_.EFF_DT} in Calendar1stQtr then {@qtd}=1.00
    else
    if {?Date Range}='QTD' and {Sheet1_.EFF_DT} in Calendar2ndQtr then {@qtd}=2.00
    else
    if {?Date Range}='QTD' and {Sheet1_.EFF_DT} in Calendar3rdQtr then {@qtd}=3.00
    else
    if {?Date Range}='QTD' and {Sheet1_.EFF_DT} in Calendar4thQtr then {@qtd}=4.00

    If all you want is to get the records with Effective date in the current quarter when QTD is chosen in the parameter then try this:
    if {?Date Range}='QTD' then
    {Sheet1_.EFF_DT} in
    select month(currentdate)
    case 1 to 3:
    Calendar1stQtr
    case 4 to 6:
    Calendar2ndQtr
    case 7 to 9:
    Calendar3rdQtr
    case 10 to 12:
    Calendar4thQtr
    default:
    date(1800,01,01) to date(1800,01,01);  // This will never process

  • Format of Loading data like Trailbalance,Supplementory data

    Hi Can one please clarify me for the following?
    format for submitting Trailbalance data is it Excel,Notepad,or do we need to do any grouping?

    Hi,
    You can do some of the setting as
    set term off;      // Suppress the display so that you can spool output without seeing the output on the screen.
    set heading off;   // Turn off heading
    set linesize 400;  // Set the number of characters per line to 400.  Adjust this number to 0 or something for your real data.
    set feedback off;  // Turn off feedback
    spool emp.txt; // Spool the output to a file named outfile.txt
    select empno||','|| ename from emp;    // Select each column from table oracle_2_table, delimiting by a comma
    spool off;Twinkle

  • Year to Date and Monthly totals

    I know that this is rather simplistic, but I'm new to Discoverer and need to set up a bunch of sales reports with MTD and YTD columns. I'm going to be using the same SQL query for many of my reports but customizing the reports to show sales by state, product line, etc.
    Is there a formula/function I can use in Discover for the Month to Date and Year to Date totals?
    Thanks,
    Joseph

    Hi Joseph
    You can use the analytic range SUM calculation for these. For the month to date, use the a PARTITION BY of month with a range of all the preceding rows in the partition up to and including the current row. For the year, you would simply change the PARTITION BY to be the year.
    Here are some examples drawn from my own database:
    I have the following items:
    ORDER_YEAR
    ORDER_MONTH
    ORDER_DATE
    SELLING_PRICE
    With these defined, the formula for month to date is:
    SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC ROWS UNBOUNDED PRECEDING)
    The formlua for year to date is:
    SUM(Selling Price SUM) OVER(PARTITION BY ORDER_YEAR  ORDER BY  ORDER_DATE ASC  ROWS  UNBOUNDED PRECEDING )
    Basically what we are doing is telling Discoverer to SUM the SELLING_PRICE, and you should be able to take these and adjust them for your own report.
    Let me take a look at the month to end and describe what is going on. Basically the PARTITION BY is defining a set of rows which are to be included. In this case it is all rows that have the same ORDER_MONTH. The ORDER BY clause tells Discoverer to place the items in order, with the oldest order first. The ROWS UNBOUNDED PRECEDING tells Discoverer to SUM all of the items within the set (within the PARTITION BY) from the oldest item (UNBOUNDED PRECEDING) to and including the current item. We could have added a BETWEEN clause too but that is implied. With a BETWEEN clause it would look like this:
    SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
    If you want the current row to be included with UNBOUNDED PRECEDING you don't need to explicitly name it because that is the default. Other options you could use are these:
    UNBOUNDED FOLLOWING - this SUMS to the end of the PARTITION
    ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING - you can guess that this will add all of the items, which you will rarely use because if you omit the ROWS command then this range between first and last is actually the default
    Rather than ROWS BETWEEN you can also say RANGE BETWEEN, like this:
    SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
    I hope this little dissertation on running totals helps.
    Best wishes
    Michael

  • Are Cube organized materialized view with Year to Date calculated measure eligible for Query Rewrite

    Hi,
    Will appreciate if someone can help me with a question regarding Cube organized MV (OLAP).
    Does cube organized materialized view with calculated measures based on time series  Year to date, inception to date  eg.
    SUM(FCT_POSITION.BASE_REALIZED_PNL) OVER (HIERARCHY DIM_CALENDAR.CALENDAR BETWEEN UNBOUNDED PRECEDING AND CURRENT MEMBER WITHIN ANCESTOR AT DIMENSION LEVEL DIM_CALENDAR."YEAR")
    are eligible for query rewrites or these are considered advanced for query rewrite purposes.
    I was hoping to find an example with YTD window function on physical fact dim tables  with optimizer rewriting it to Cube Org. MV but not much success.
    Thanks in advance

    I dont think this is possible.
    (My own reasoning)
    Part of the reason query rewrite works for base measures only (not calc measures in olap like ytd would be) is due to the fact that the data is staged in olap but its lineage is understandable via the olap cube mappings. That dependency/source identification is lost when we build calculated measures in olap and i think its almost impossible for optimizer to understand the finer points relating to an olap calculation defined via olap calculation (olap dml or olap expression) and also match it with the equivalent calculation using relational sql expression. The difficulty may be because both the olap ytd as well as relational ytd defined via sum() over (partition by ... order by ...) have many non-standard variations of the same calculation/definition. E.g: You can choose to use or choose not to use the option relating to IGNORE NULLs within the sql analytic function. OLAP defn may use NASKIP or NASKIP2.
    I tried to search for query rewrite solutions for Inventory stock based calculations (aggregation along time=last value along time) and see if olap cube with cube aggregation option set to "Last non-na hierarchical value" works as an alternative to relational calculation. My experience has been that its not possible. You can do it relationally or you can do it via olap but your application needs to be aware of each and make the appropriate backend sql/call. In such cases, you cannot make olap (aw/cubes/dimensions) appear magically behind the scenes to fulfill the query execution while appearing to work relationally.
    HTH
    Shankar

  • Need total consumption quantity year to date for item in inventory

    Hi All,
    I have a requirement as below.
    I need to find the total consumption quantity for a item year to date in inventory i.e i need to find out total issued quantity from year to date for a item.
    so i need following details.
    Consumption 1st year
    Consumption 2nd year
    Consumption 3rd year
    we are following fiscal year JAN-DEC.
    I am looking for a query to find out the above details, please help me out
    Thanks

    Hi Prashant,
    I will try this out. If I remember correctly this did not work especially since we are using the same base condition across the board. I may have to try copying this standard condition and re-assigning it accordingly.
    Thanks for the suggestion
    Anirudh

  • Year to Date Problem on Monthly Loads

    Hi SDN team,
    I have few clarifications necessary.
    I've a query & it uses 2 structures. we decide to use cells using cell editor afterwards.
    We have plan versus actual issue. One row is plan for one full year. We have a plan figure for each month of year 2004, from Jan till Dec. Now I need to create a totals. Is it possible to create total column for this?
    In that column the plan figures ahould be shown as sum for the "year to date-values" - for example from Jan'04 till Apr'04 or Jun'04, not the totals for the whole year.
    Selected Month SEP. Plan from Jan - Dec. Totals: 2*Total. Total we  need: Sum (year to date because of month). If there's any solution for this please let me know.

    Hi, You need to add the YTD logic/functions between the 2 statements... Please try this... I've added the crude logic here. Pls. refine as you need for your requirement.
    WHEN 'VAR4JUN'.
        IF I_STEP = '2'.
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                      WHERE VNAM = 'ZYOUR_VARIABLE'.
    ** DATA INITIALIZATION **  (This is optional)
            TV4Y = LOC_VAR_RANGE-LOW+0(4). ** YEAR
            TV4M = LOC_VAR_RANGE-LOW+4(2). ** MONTH
    ** FUNCTION **
            CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
              EXPORTING     INPUT  = TV4M
              IMPORTING       OUTPUT = TV4M.
    ** DATA LOGIC FOR YTD**
            IF TV4M= '06' OR TV4M= '07' OR TV4M= '08' OR
                TV4M= '09' OR TV4M= '10' OR TV4M= '11' OR TV4M= '12'.
                      CONCATENATE TV4Y '06' INTO L_S_RANGE-LOW. ** Also for HIGH
            ELSEIF TV4M= '01' OR TV4M= '02' OR TV4M= '03'.              
                      TV4Y = TV4Y - 1.
              CONCATENATE TV4Y '06' INTO L_S_RANGE-LOW.. ** Also for HIGH
            ENDIF.
                    L_S_RANGE-SIGN = 'I'.
                    L_S_RANGE-OPT = 'EQ'.
            APPEND L_S_RANGE TO E_T_RANGE.
          ENDLOOP.
        ENDIF.

  • Split month, date and year

    How to split month,date and year from date field ? is there any standard function module.

    You can do this.
    data: year(4) type c,
          month(2) type c,
          day(2) type c.
    year = sy-datum(4).
    month = sy-datum+4(2).
    day = sy-datum+6(2).
    write:/ year.
    write:/ month.
    write:/ day.
    Regards,
    Rich Heilman

  • How to get total or sum year to date or date range

    Is there a way to duplicate in Numbers what I used to do with Excel's formula =DSUM(Database,"Total",Criteria) where criteria would be any date I plugged into a referenced cell to get a year to date total. Thanks! DBT

    As described in the Help which offers a list of available functions(),
    In cell B1 of Tableau 2, the formula is:
    =SUMIF(Database :: B,A,Database :: C)
    In cell B2 of Tableau 2 is an alternate formula which doesn't requires an auxiliary cell like A1
    =SUMIF(Database :: B,DATE(2008,3,3),Database :: C)
    Yvan KOENIG (from FRANCE lundi 17 novembre 2008 17:16:46)

Maybe you are looking for

  • SSO Application Configuration .msc - Unable to load mmc and unable to uninstall/repair

    This tool was installed on a QA server by an ex-employee and nobody knows for sure if it ever worked.  Attempting to uninstall/repair fails with below errors in the event log. The description for Event ID 11001 from source MsiInstaller cannot be foun

  • Cell Text greyed out in Hyperion Menu of Excel

    Hi all, anybody has an idea why the Cell Text Menu is greyed out in Excel via Smart View when I am accessing my Essbase cube. When I am using the Excel Add-in I can edit the Cell Text. Thanks, Bernd

  • How to know the report has already been sent to printer?

    Dear All, I have one problem to check that the report has been printed on paper through a printer after user already previewed and pressed Printer button. Is there any parameter will be sent back from system to inform the program? Please suggest me i

  • Two icloud accounts- probs

    I've got two iCloud accounts, poss even three, not done intentionally but historically through ignorance of how the whole iCloud, Apple ID, iTunes, iMessage thing works. My Mac is signed in to one account but my iPhone is signed into another. I want

  • Cost center on CAT2

    Is there a way to default funds/cost center  in CAT2 screen? Our requirement is to control the way the cost/funds center appear in the CAT2 screen based on the position the employee holds. If the position is XYZ, then the cost/funds center should eit