How do I calculate Year to Date?

Dear Colleagues,
I need to calculate Year to Date-revenue. Date is a prompt input, so the customer can choose which ever day he wants. How can I get revenue YTD based on the input? Is this a BODI assigment more than a BO assignment?
Looking forward to give you some points!
Regards Silje

Hi Silje,
Normally you would build objects like this in designer (oracle syntax):
sum(case when tab.datecolumn
between (@prompt('give ytd date','D',,mono,free)-to_number(to_char(@prompt('give ytd date','D',,mono,free),'ddd'))
and @prompt('give ytd date','D',,mono,free) then tab.amountcolumn
end)
So basically sum all the amounts only if they are between the start of the year and the given date.
You use simple date manipulation to get to the right when condition, it can be based of a prompted date,
but also of the sysdate (current date).
There are dozens of variants here, you can build
year to date amounts (this year, last year, given year),
period amounts (given period, current period, last full period),
week amounts (current week, last week, last x weeks), full year amounts, etc.
you get the idea...
So get your wish list ready and talk to your designer...
Hope this helps,
Marianne
P.S. should you wish to do it in the report, use a prompted date object in the query & select the date to compare in the query (note that you might get an awful lot of row back here)
sum(<amount object> where (<date object> between <given date>-ToNumber(FormatDate(<given date>,"ddd")) and <given date>)

Similar Messages

  • How to Find the Year to Date ?

    Dear Experts
    How to find the Year to date in BI 7.0 i.e(1st April of Current year  to Tilldate) is there any Standard Variable is there ,Please let me know .as we are needed in our project.
    Thanks in Advance
    Satish

    Hi,
    I hope Stadard variables(Cumilated upto current fiscal year-0FYTCFP) will be avalable for this kind of requirement. Try to create a restricted key fig by make use of the standard variables...
    This is just my assumption.
    Message was edited by:
            Kameswari Ponnuri

  • How to derive month/year from date in SAP BW 3.5 data flow

    Hi
    How we can derive cal year/month and fiscal month/year from date in SAP BW 3.5 data flow (we're using transfer and update rule)..
    Thanks,
    PK

    Hi,
    if you have any date filed in source side you can just map to any time char system will automatically convert to target objects.
    please look at the screen shot for understanding. (not 3.x it is 7.x)
    Thanks,
    Phani.

  • Calculate year to date

    Hi experts,
    I have been asked to creae a keyfigure which displays value of entered Fiscal period as well as year to date for the same Key figure.
    The Key figure is 0NET_VALUE. Can somebody provide me with the code to caculate it. I have named the user exit variable 'znetyear'.
    Thank you for your help in advance.

    You have to use Customer Exit for calculating YTD frm Fiscal Period.
    Customer Exit - > YTD from Fiscal Period
    Let ZVCCYTDX be the tech name of Customer Exit Variable & 0P_FPER be the user entered variable for Fiscal Year Period.
    User Exit: ZVCCYTDX
    Input: 0P_FPER
    Output: Jan of Accident Year Range
    Logic Description:
    WHEN 'ZVCCYTDX'.
    if i_step = 2.
    clear loc_var_range.
    loop at i_t_var_range into loc_var_range WHERE vnam = '0P_FPER '.
    if sy-subrc = 0.
    curr_year = loc_var_range-low(4).
    concatenate curr_year '001' into jan_accidentyear.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = jan_accidentyear.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    append l_s_range to e_t_range.
    exit.
    **endif.
    endloop.
    endif.
    **Coding is not required if you can enhance the Datatarget with Fiscal Year and Posting Period.

  • How to create a year to date filter?

    All,
    I would like to create a date range filter on the opportunity close date column so that the report retrieves records with a close date between the beginning of the current calendar year and the current date.
    I am having trouble using date/time functions to establish the first day of the current calendar year.
    Any help is appreciated.
    Thanks,
    Dan

    I'm so sorry... I missed this thread and have not replied.
    You could place a filter on the Fiscal Year column in the Date Dimension folder of your subject area to get Fiscal Year to Date (most of the time):
    Date."Fiscal Year" = VALUEOF(NQ_SESSION.CURRENT_YEAR)
    This would likely not work, however, if the current year is 2008 and you are already in Fiscal Year 2009.
    To allow for this, your filters become much more complex. I will use Opportunity Close Date in my example.
    First, we want to ensure that no data in the report is more than one year old...
    TIMESTAMPDIFF(SQL_TSI_DAY, Opportunity."Close Date", CURRENT_DATE) < 366
    With the next filter, we want to ensure that the data in the report is not from months outside of the fiscal year. You can do this with a CASE statement in a hidden column.
    CASE WHEN MONTH(Opportunity."Close Date") > 06 AND YEAR(Opportunity."Close Date") < VALUEOF(NQ_SESSION.CURRENT_YEAR) THEN 'Current Fiscal Year'
    WHEN MONTH(Opportunity."Close Date") < 06 AND YEAR(Opportunity."Close Date") = VALUEOF(NQ_SESSION.CURRENT_YEAR) THEN 'Current Fiscal Year'
    ELSE 'Not Current Fiscal Year' END
    Your Filter will be:
    CASE WHEN MONTH(Opportunity."Close Date") > 06 AND YEAR(Opportunity."Close Date") < VALUEOF(NQ_SESSION.CURRENT_YEAR) THEN 'Current Fiscal Year'
    WHEN MONTH(Opportunity."Close Date") < 06 AND YEAR(Opportunity."Close Date") = VALUEOF(NQ_SESSION.CURRENT_YEAR) THEN 'Current Fiscal Year'
    ELSE 'Not Current Fiscal Year' END = 'Current Fiscal Year'
    Assuming my code is correct, July 2007 - June 2008 evaluates as current fiscal year and July 2008+ evaluates as not current fiscal year.
    There are bound to be other ways to accomplish this, but this is one method that should work.
    Regards,
    Mike L

  • How to create a Year to Date Query when only Monthly values are in the data

    Hi SDN community,
    Is it possible to create a query by dragging in the fiscal year period characteristic , and any other required characteristics in the rows,
    and then use functionality to have columns of data that add up the previous periods. 
    ex.  the month of sept, = Jul + aug + sep
    i basically want to see 12 columns of Actuals,
    and then a trend line, to add up those columns.
    If we load up the data with a YTD time variant out of the system and load, then this is fine, but can we do it with the query and how.
    Thank you.
    Simon

    Hi,
    ex. the month of sept, = Jul + aug + sep
    Of course it is possible in Query,
    -->Create a formula on the key fig.
                   NoDim(<Key Fig Name>)
    -->in Property of that formula, in Calculation Tab
    -->Check the Cumulative Property
    -->Select Either Along Rows or Along Columns as per your requirement
    please give more details, so I can provide Full steps for that..
    Best regards
    Obaid

  • How to know fiscal year start date?

    How can I know when is the starting date of the fiscal year of my company from the tables or FM? They told me it is April 1st. Can I get this information from any SAP tables? I just don't want to hardcode that in my report.
    Thank you very much.

    U can try the FM 'FIRST_AND_LAST_DAY_IN_YEAR_GET'
    REPORT ZEXAMPLE.
    DATA: V_FIRST LIKE SY-DATUM,
          V_LAST LIKE SY-DATUM.
    PARAMETERS: P_GJAHR LIKE T009B-BDATJ,
                P_PERIV LIKE T009B-PERIV.
    CALL FUNCTION 'FIRST_AND_LAST_DAY_IN_YEAR_GET'
         EXPORTING
              I_GJAHR        = P_GJAHR
              I_PERIV        = P_PERIV
         IMPORTING
              E_FIRST_DAY    = V_FIRST
              E_LAST_DAY     = V_LAST
         EXCEPTIONS
              INPUT_FALSE    = 1
              T009_NOTFOUND  = 2
              T009B_NOTFOUND = 3
              OTHERS         = 4.
    IF SY-SUBRC EQ 0.
      WRITE:/ P_GJAHR, '\', P_PERIV,
            / 'FIRST DAY:', V_FIRST,
            / 'LAST DAY:', V_LAST.
    ELSE.
      WRITE:/ 'COULD NOT DETERMINE DATES FOR', P_GJAHR, P_PERIV.
    ENDIF.

  • How to use previous year keyfigure data in current year for other keyfig

    Hi Expert,
    I have 1 requirement wherein I need to use previous year data for some keyfigure calculation.
    Details are as follows:
    I have designed query with CKFs Turnover & UVG (in rows) & Fiscal year period in columns.
    Suppose Keyfigure Turnover data is displayed from Apr2009 to Mar 2011. In UVG: for Apr 2010, i need Turover data of month Apr 2009, for May 2010 turnover data of May 2009 similarly for other months.
    As per my understanding, I need to use customer exit which will store kf turnover data in internal table & in turn it will be used for UVG.
    But I'm not able to put it into syntax.
    Kindly suggest your inputs in this scenario.
    Thanks,
    Shamkant

    Hi
    Note that the variable ZCALCCALMTH is exit type and variable ZCALMTHREF is ready for input.
    WHEN 'ZCALCCALMTH'.
    IF i_step = 2. "après le popup
    READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZCALMTHREF'.
    IF sy-subrc = 0.
    CLEAR l_s_range.
    year1(4) = loc_var_range-low(4).
    year1(4) = zyear1(4) - 1.
    zmonth1(2) = loc_var_range-low+4(2).
    CONCATENATE zyear1(4) zmonth1(2) INTO loc_var_range-low(6).
    zyear2(4) = loc_var_range-high(4).
    zyear2(4) = zyear2(4) - 1.
    zmonth2(2) = loc_var_range-high+4(2).
    CONCATENATE zyear2(4) zmonth2(2) INTO loc_var_range-high(6).
    l_s_range-low = loc_var_range-low(6).
    l_s_range-high = loc_var_range-high(6).
    l_s_range-sign = 'I'.
    l_s_range-opt = 'BT'.
    APPEND l_s_range TO e_t_range.
    ENDIF.
    ENDIF.
    bye
    Boujema

  • How do I show "year" in date received or sent columns?

    +My constant struggle with Mail goes on but I am not giving up yet.+
    Mail shows me month, day, hour and minute. But not the year of messages received or sent.
    When I upgraded to Snow Leopard and switched from using Entourage to Mail, I imported all my mail and folders. That part worked ok. However, none of those messages - or current new ones, show the year of the message. Since I have a lot of messages stored in folders that span a few years this is very confusing.
    I have searched Mail Help; I tried every Preference option I thought made any sense, but I cannot find anything that allows me to show Year in the Date Received or Sent columns.
    Please, can anyone point me in the right direction?

    Hello.
    What do you mean "see if it is displaying the date?"
    That pull down menu offers four options: none, default, all or custom. There's nothing there pertaining to date.
    In any case, I have tried all four and, of course, none make the date appear in Received or Sent columns. I say, of course, because this drop down is about Headers. I don't want to and shouldn't have to look into each message to see the date. The date - the year as well as month, day, etc., should show in the inbox columns.
    This is seriously nuts that it doesn't and that I cannot find a way to make it do so.

  • How do I calculate and validate DATES?

    Let's say after a time set the user will have a "pending charge".
    if per each additional day he will be charged 1.00
    how can I do that it validates the months.
    the to_char or to_date.
    I.E
    select to_char(date1, 'DD-MM-YYYY') - to_char(sysdate, 'DD-MM-YYYY') from table;
    that sentence will only validate for 1 month
    if the charge is made with several months of delay it will still charge maximum 30 or 31 days (after next month it will reset to 1)
    you got me?

    select to_char(date1, 'DD-MM-YYYY') - to_char(sysdate, 'DD-MM-YYYY') from table;Will something like this work for you?
    SELECT (TRUNC(SYSDATE) - TRUNC(t.due_date)) * (:late_fee_per_day) FROM table t;Michael

  • YTD(year to date) Sales [List Price/ Gross Sales ]

    How to create YTD(year to date) Sales [List Price/ Gross Sales ] depending on the selection in filter

    Do you have the measure names as list of values in prompt?
    Rgds,
    Dpka

  • Year to date sales

    I'm trying to calculate year to date sales value. If I have more than one packet size my values do not match expected results. Is there a way I can have all data in single packet in start routine or end routine. I don't want to make cahnge to setting in DTP. My initial package should pick all values.
    For example:
    Comp Month Sales
    A        1         1
    A        2         2
    A        3         3
    A        4         4
    A        5         5
    A        6         6
    A        7         7
    A        8         8
    My expected result should be:
    A        1         1
    A        2         1 + 2 = 3
    A        3         3 + 3 = 6
    A        4         6 + 4 = 10
    A        5         10 + 5 = 15
    A        6         15 + 6 = 21
    A        7         21 + 7 = 28
    A        8         28 + 8 = 36
    If I have two packets ( size 4each) then my calculation doesn't match the expected results
    A        1         1
    A        2         1 + 2 = 3
    A        3         3 + 3 = 6
    A        4         6 + 4 = 10
    A        5          5
    A        6         5 + 6 = 11
    A        7         11 + 7 = 18
    A        8         18 + 8 = 26
    Can any one hlep me to resolve this issue.

    Hi,
    The best way is....
    Create a report and calculate it in Report like below.
    Create a Customer Exit Variable called FMYEAR on 0CALMONTH and then write code like below.
    DATA :  l_s_range TYPE rsr_s_rangesid,
                loc_var_range LIKE rrrangeexit,
                zbdatj LIKE t009b-bdatj,
               zbuper LIKE t009b-poper,
    First Month Of Current Fiscal year comment*
        WHEN 'FMYEAR'.
          CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
                 EXPORTING
                   i_date               = sy-datum
            I_MONMIT             = 00
                   i_periv              = 'V3'
                IMPORTING
                  e_buper              =  zbuper
                  e_gjahr              =  zbdatj.
          CLEAR: l_s_range.
          l_s_range-low+4(2) = '04'.
          l_s_range-low+0(4) = zbdatj.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          APPEND l_s_range TO e_t_range.
    and then create a restricted Kefigure with 0CALMONTH and value, and restrict calmonth with FMYEAR;0CALMONTH (there are variables and the values are  in between FMYEAR;0CALMONTH)
    Thanks
    Reddy

  • How to calculate Prior Year To Date in SSRS

    Hi,
    I've been developing reports in Crystal for a while. The new ERP software we have just purchased uses SSRS for all of their reports. I just started converting the crystal reports to SSRS. I can't seem to find an easy way to do a calculation for Prior Year
    to Date or Prior Year Month to Date in SSRS. Can somebody help me?
    Thanks,
    Cindy

    Your best bet would be to use a calendar table in the TSQL queries. I wrote an article on them here: http://social.technet.microsoft.com/wiki/contents/articles/29260.tsql-calendar-functions-and-tables.aspx
    Alternatively you can use a formula like:
    =DateValue(DATEADD(DateInterval.Day,1-DATEPART(DateInterval.DayOfYear,NOW()),Now()))
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

  • I wanted to know how do you calculate the number of days between two dates

    i wanted to know how do you calculate the number of days between two dates in java ? i get both the dates from the database. i guess there are many issues like leap year and Febuary having diff no of months ..etc.

    thanks..
    I solve my problem as
    public class MyExample {
        public static void main(String a[]) {
            String stdate = "2009-03-01";
            java.sql.Date currentDate = new java.sql.Date(System.currentTimeMillis());
            java.sql.Date preDate = java.sql.Date.valueOf(stdate);
            System.out.println(currentDate);
            System.out.println(preDate);
    //        int dateCom = preDate.compareTo(currentDate);
    //        System.out.println(dateCom);
            long diff = currentDate.getTime() - preDate.getTime();
            int days = (int) Math.floor(diff / (24 * 60 * 60 * 1000));
             System.out.println(days);
    }

  • How to fetch year till date value for earning for current ,last and year

    hi,
    how to fetch year till date value for earning for current ,last and year before that from payroll result
    plz reply soon,
    pratyush

    Dear Pratyush,
    Pick this from CRT.
    Use LDB PNPCE & Fire event GET PAYROLL &
    then you can pick from CRT.
    Hope this helps.
    Kindly reward in case useful.
    Regards & Thanks,
    Darshan Mulmule

Maybe you are looking for

  • HT4236 Mac 10.9.2 and latest version of iPad (7.0.6)

    On Mac 10.9.2 and latest version of iPad (7.0.6), in Iphoto 11.1.5, I cannot sync pictures from iPhoto. The only option is "Folders". What's the problem?

  • Installing iTunes on Windows Vista Ultimate (32bit)

    I can't get the latest version of iTunes to install on my Vista machine (which is part of a Windows Server domain). It says the app is unsigned, pops up the various alert boxes asking me what to do. Selecting the options that allow installation and..

  • Project management + Source Control

    we are using labview 8.5 and not well known source control in a team environment. I'm not sure if it is the souce control that I'm using or other searsons, but I had so much trouble using those combination. I want to know what others thought about pr

  • Master Data issue from external system to BW

    Hi, BW Version: BI 7.0 Source System : Oracle D/B The Data will be processed by some external application and the processes Data will be stored in tables in Oracle D/B.I am extracting Data from Oracle Tables to BW. The issue i had is in the external

  • Printing output for F.27

    Hi,   I am using F.27 transaction for printing customers who have open balences. i have copied the standard program RFKORD11 and created the Z program as ZRFKORD11. now the thing is if there is no opening balances for a customer its printing output.