Till Last Year, To Date -  Discoverer......

We have following table X
PNO Date Amount
10 10/31/2006 10
10 11/30/2006 15
10 11/30/2007 20
10 12/31/2007 30
10 1/31/2008 15
10 2/29/2008 25
10 3/31/2008 40
We need to create report as follows, the parameter is the Date.
Lets say user pass parameter : 3/31/2008
The report should look like,
PNO TillLastYear To date
10 75 155
Till Last Year - Sum of Amount column till Last Year
To Date - Sum of Amount Column to the date parameter passed.
Could some on guide me how to achieve this......?

Hi,
You need to add the PNO item into your report and then create calculations based on your date item:
TillLastYear SUM(CASE WHEN DateItem < TRUNC(SYSDATE,'Y') THEN Amount END)
ToDate SUM(CASE WHEN DateItem < :DateParameter THEN Amount END)
Rod West

Similar Messages

  • Last year to date

    afternoon all,
    I am so confuse with these year to date dates, what is the best practice if you want to get all the dates from last year upto today's date.
    For example, Today is 16/01/2009, so effectively the last year to date would be 16/01/2008 to 16/01/2009.
    I am thinking of using =Today-365
    or  =Currentdate-365
    or  =(dateserial('y',-1,)
    Perhaps you can give me some ideas?
    Regards
    Jehanzeb

    I forgot to ask another question. I am using the following formula under my Record Selection formula,
    Does this formula means from Last year to date?
    ({lab_rework.rework_date} in date(year(currentdate),1,1) to
    dateserial(year(currentdate), month(currentdate)+1,1)-1
    Sorry but I am so confused with these date formulas.
    The purpose is to get last year to date records, that is 16/01/2008 to 16/01/2009 where 16 is currentdate.
    Regards
    Jehanzeb

  • Last year-to-date figure

    Hello Experts -
    I'm using a customer exit variable to calculate the beginning of the year. And I have a variable input for a calendar month.
    I'm using these two values to get the year-to-date figure.
    How can I calculate the last year-to-date figure?
    Thanks a lot in advance.

    Thanks for the prompt replies.
    I don't have a year so thats why i'm using a customer exit.
    another thing is my calendar month is not the 0CALMONTH. i had to derive it from a timestamp. and its not a time characteristic which we can't create.
    its a NUMC. and i think thats why the offset isn't working either.

  • Last year column data not displying

    Dear All,
    I am working on one of reporting issue where data is not getting displayed for few Last year columns. I have checked at the back end and data is available in info providers.
    I want your help to identify possible reason. I carried below trouble shooting steps.
    1: checked data in back end and its available
    2: all restrictions are proper.
    3: there no issue with query properties, I check all.
    I am doubtful about customer exit code so here it is. Please suggest me whether its good or not.
    WHEN 'ZVAR_LYCW'.
        IF I_STEP = 2.
          CLEAR LOC_VAR_RANGE.
         BREAK-POINT.
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
          WHERE VNAM = 'ZVAR_CALDAY'.
            CLEAR : L_S_RANGE,
                    v_loc_date,
                    v_loc_date1.
            L_S_RANGE-LOW = LOC_VAR_RANGE-LOW.
            L_S_RANGE-LOW(4) = L_S_RANGE-LOW(4) - 1. "low value previos year
            L_S_RANGE-HIGH = LOC_VAR_RANGE-HIGH.
            L_S_RANGE-HIGH(4) = L_S_RANGE-HIGH(4) - 1.
            v_loc_date = L_S_RANGE-LOW. "take input value in another variable
            v_loc_date1 =  L_S_RANGE-HIGH.
            L_S_RANGE-LOW =  v_loc_date.
            L_S_RANGE-HIGH = v_loc_date1. "high value = input, taken into another variable
            L_S_RANGE-SIGN = 'I'.
            L_S_RANGE-OPT = 'BT'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        endif.
    Please help.
    Thanks,
    Vishal

    Hi vishal,
    try this:
    WHEN 'ZVAR_LYCW'.
    IF I_STEP = 2.
    CLEAR LOC_VAR_RANGE,L_S_RANGE,
    v_loc_date,
    v_loc_date1.
    * BREAK-POINT.
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'ZVAR_CALDAY'.
    v_loc_date =  LOC_VAR_RANGE-LOW+0(4) - 1.
    v_loc_date1 = LOC_VAR_RANGE-HIGH+0(4)-1.
    L_S_RANGE-LOW = v_loc_date.
    L_S_RANGE-HIGH = v_loc_date1.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    endif.
    Edited by: JAIGUPTA on Jan 20, 2012 6:14 PM

  • Assign Assets value date bydefault as last year doc date.

    My scenario is :
    Assets Purchased date is 01-02.2009(which comes in last year) & we are posting it today.
    I keep default value date as doc date.
    But it comes by default  when i post in same fiscal yr.When i post with last yr doc date,then it takes today date as value date.
    How to keep last yr doc date as value date?

    Thanks.
    I have kept the rule as 3-prime & 4-Alternative.
    Still i m not getting .
    Posting date       01.07.2009
    Document date : 01.02.2009
    So i want Valie date as 01.02.2009.
    I think this rule is applicable in same yr of Posting & Value date only.
    When i use date within same yr then this rule getting apply,but when i used different fiscal yr then it takes Posting date as value date.
    So how to Keep value date as doc dt( which is in last yr) ?

  • To find last year's data / a particular year's data

    Hi ,
    How to find out the data for the entire last year , i tried like
    entered_date between to_char( '12/31/2008 11:59:59', 'MM/DD/YYYY HH12:MI:SS')
    and to_char('01/01/2010 00:00:00', 'MM/DD/YYYY HH12:MI:SS' ) , but it is an invalid number error.
    thanks.

    Hi,
    If you want something that doesn't require hard-coding a year, but automatically figures out what year it is:
    WHERE   entered_date     >= ADD_MONTHS ( TRUNC (SYSDATE, 'YEAR')
                                              , -24
    AND     entered_date     <  ADD_MONTHS ( TRUNC (SYSDATE, 'YEAR')
                                              , -12
                                    )There are a couple of things to notice about the expression you posted (besides using TO_CHAR instead of TO_DATE):
    WHERE  entered_date     BETWEEN TO_DATE ('12/31/2008 11:59:59', 'MM/DD/YYYY HH12:MI:SS')
                          AND       TO_DATE ('01/01/2010 00:00:00', 'MM/DD/YYYY HH12:MI:SS')BETWEEN includes both endpoints, so the expression above covers a tiny bit more than one year. It includes one second from 2008 and one second from 2010, as well as all of 2009.
    Currently 2010 is the last year, so the expression you posted (as well as my suggestion) is actually for the year before last year, but it can easily be changed for any year.

  • Need to get data till last month end by using Calday

    Hello SAPiens,
    Could anybody please guide me how to get the data till last month end date.
    Example: If i m executing a report in 05 November 2009 then i should get all the details of last month till last date of the Calmonth. thanks in advance.
    Regards,
    Sandy.S

    Hi,
    you can do the following:
    Create a Customer Variable for Calday
    EXIT_SAPLRSOO_001 ---> Include ZXRSRUO1 write the code for the variable created above
    DATA : date TYPE sy-datum.
    date = sy-datum. "Today
    date+6(2) = '01'. "First day of this month
    date = date - 1. "Previous day before first day of this month = last day of last month
    Or
    you can you many function Modules
    CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS
    FKK_LAST_DAY_OF_MONTH
    OIL_LAST_DAY_OF_PREVIOUS_MONTH
    Santosh

  • Dates -- Pulling the last year data!, which should'nt be the case.

    Need some basic SQL Help ..
    Iam supposed to pull the data based on a date column(end_time) -- Yesterday 3PM untill Today's 3PM.
    Iam getting last year's data too in additon to Current Data.
    Where am i comparing wrong??
    SELECT a.*
    FROM table a
    WHERE TO_CHAR (a.action_end_time, 'MM/DD/YYYY HH24:MM:SS') >=
    TO_CHAR (SYSDATE - 1, 'MM/DD/YYYY')
    || ' 15:00:00'
    AND TO_CHAR (a.action_end_time, 'MM/DD/YYYY HH24:MM:SS') <=
    TO_CHAR (SYSDATE, 'MM/DD/YYYY')
    || ' 15:00:00'
    ORDER BY a.end_time;

    Date math, 1 = 1 day 1 / 24 = 1 hour, trunc with no date format gives midnight
    Try this.
    select a.* from table a where
      a.action_end_time between trunc(sysdate) + (15 * 1 / 24)
                            and trunc(sysdate - 1) + (15 * 1 / 24) In your example you are comparing strings, not dates.

  • Sales Summary - Compare same weekday sales last year.

    Post Author: geoffh
    CA Forum: Formula
    I have a table storing invoices going back several years. I wish to calculate the total sales for yesterdays date, & compare it with total sales for the same weekday in the previous year. For example if it is Tuesday today, I need to calculate Mondays total sales (yesterday) & also Mondays total sales for the same week period last year.
    Date fields I have available are 'history.date_invoiced' (invoice date) , history.week_invoiced , history_year.invoiced. Sales values are history.sell_account & history.sell_cash.
    I'm new to crystal.......Using V 11.0.0.1282 . Any help would be greatly appreciated.

    Post Author: yangster
    CA Forum: Formula
    create a formula with the following informationnumbervar weeknumber_curr_year := datepart("ww", dateadd("d", -1, ));numbervar weekdaynumber_curr_year := datepart("d", , 1);  //assuming sunday is the start date of the week, change to 2 if monday isthose 2 variables will tell you the current week number and what day of the week you are after for the current yearnumbervar last_year := dateadd("yyyy", -1, currentdate);if year() = last_year and datepart("ww", ) = weeknumber_curr_year anddatepart("d", , 1) = weekdaynumber_curr_year then amt_field else 0put that in the details section and create a summary of the formula and you should have the total sum of sales for exactly the same week and day of week one year prior to yesterdaymaybe kai has a more simplified solution but that's what comes off the top of my head

  • Last Year Sales Report

    I have a requirement where say user selects year and months by prompts eg. 2008 jan and 2008 feb. It should also give me sales for last year and should be arranged as rows.
    2008 Jan Sales
    2008 Feb Sales
    2007 Jan Sales
    2007 Feb Sales
    How to go about it?
    Thanks

    You would need to expose another column (you can hide it, of course) that contains the month number (monthnum) equivalent (1 - 12) of the month name (Jan - Dec). Set primary sorting (1) to the year in descending order and secondary sorting (2) to the monthnum column in ascending order.
    As for getting "last year's" data from the prompt, say you have a prompt called "Year." Then you would create two "year" filters, on the Year column, as follows:
    "column name".year = @{Year}
    OR
    "column name".year = @{Year}-1
    This will pull both the "prompt year" and the year before.

  • Last Yr Plan Data Vs Current yr Plan Data

    Hi gurus,
    Cd some one tell me when we are into a situaion where need to compare Plan Values Vs Last Yr and Current Yr,
    1. How we are going to do this.
    2. How Versions will be differentiated?
    3. Will be Plan Valus of Last Year still can be changed or else they will be in  
        Display Mode. For me it does not make sense to change Last Year Plan Data.
    Thanks a lot for all your kind inputs.
    Quick assistance is highly appreciated.
    Regards,
    BI-IP Guest

    Hi ,
    I think u can take a multiprovider on three cubes in which
    1.)The last year content will be in the standard infocube (b'coz according to any business data can be changed within a particular time limit)
    2.) The current year's content also u have to put in standard infocube
    3.) The plan data u can put in real time infocube on which u can define aggregation level and planning function and sequences.
    now u can report on the multiprovider by which u can compare the data on the respective three years.
    Regards,
    Supriya

  • How you will see reports last year and till date reports and compare?

    How you will see reports last year and till date reports and how you will compare?
    sridhar

    Hi.
        This you can achieve at query level.
    I have few question.. First let me know how many KFs you have in the query and based on what characteristic you want to compare the KFs.
    Let me assume that you want to compare "SALES" KF for the last and current year.
    1) Add the "SALES" KF to the Query.
    2) Rename it as "SALES - Prior Year"
    3) Copy the above KF and rename the new KF as "SALES - Current Year"
    4) In the "SALES - Prior Year", add the date (say, Calendar Date, Fiscal Period, etc.) as per yr requirement. Keep offset as "-1"
    5) Do the same for "SALES - Current Year" . No offset.
    6) Now create a new formula to find the difference between "SALES - Prior Year"  and "SALES - Current Year" .
    Hope you got some idea!!
    Let me know if anything more is required.
    Regards,
    Balaji V

  • SSRS expression for today,yesterday,Lastweek ,Last fortnight,Last Month, Year to date

    Hi All;
    I have a field called createdon 
    Using this field i need to create the SSRS expression for the table as below 
    Any help much appreciated
    Thanks
    Pradnya07

    use expressions as below
    assuming this is to be done in SSRS
    Today
    =COUNT(IIF(
    DateDiff(DateInterval.Day,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Day,Cdate("01/01/1900"),Now()),Fields!YourRequiredField.Value,Nothing))
    Yesterday
    =COUNT(IIF(
    DateDiff(DateInterval.Day,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Day,Cdate("01/01/1900"),Now())-1,Fields!YourRequiredField.Value,Nothing))
    LastWeek
    =COUNT(IIF(
    DateDiff(DateInterval.Week,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Week,Cdate("01/01/1900"),Now())-1,Fields!YourRequiredField.Value,Nothing))
    Last fortnight
    =COUNT(IIF(
    (DateDiff(DateInterval.Week,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Week,Cdate("01/01/1900"),Now())-1)
    Or (DateDiff(DateInterval.Week,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Week,Cdate("01/01/1900"),Now())-2),Fields!YourRequiredField.Value,Nothing))
    Last Month
    =COUNT(IIF(DateDiff(DateInterval.Month,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Month,Cdate("01/01/1900"),Now())-1,Fields!YourRequiredField.Value,Nothing))
    Year To Date
    =COUNT(IIF(DateDiff(DateInterval.Year,Cdate("01/01/1900"),Fields!createdon.Value) = DateDiff(DateInterval.Year,Cdate("01/01/1900"),Now())
    And
    DateDiff(DateInterval.Day,Cdate("01/01/1900"),Fields!createdon.Value) <= DateDiff(DateInterval.Day,Cdate("01/01/1900"),Now()),Fields!YourRequiredField.Value,Nothing))
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • 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

  • Just bought a new iphone 5 i have an old imac computer OSX 10.5.8 and itune version 10 (updated at great cost last year for iphone4) it dosen't let me restore data... any chance of update or do i have to thow away my computer (and never by Mac aga data 0

    Just bought a new iphone 5, i have an old imac computer OSX 10.5.8 and itune version 10 (updated at great cost last year for iphone4) it dosen't let me restore data... any chance of update or do i have to thow away my computer (and never by Mac again?)

    You an use your iPhone without connecting it to a computer.
    But the product description for the iPhone clearly states that in order to sync with a Mac you must have OSX 10.6.8 or later. That version of the OSX is usually called Snow Leopard. There are two mo recent versions of OSX. OSX 10.7.x (Lion) and OSX 10.8.x (Mountain Lion).
    If you can upgrade your computer to at least Snow Leopard I suggest you do so.

Maybe you are looking for

  • Error : Your session is no longer valid. Please login again.

    Hi partners, I am getting next error message when users want to get access to this cloned environment: <b>Error : Your session is no longer valid. Please login again.</b> I have test everything: "AOL TEST", "Regeneration of JAR files" and "Clearing t

  • AS2 to AS3 conversion... external array files

    I'm at the tail end of writing an app in ActionScript2 for a client and was just told that it needs to be rewritten in ActionScript3. ((8-0 I'm pretty good at AS2, very new to AS3. So here's a question (the first of many, I'm afraid): I currently hav

  • Reg : BAPI module

    I know of one function module BAPISDORDER_GETDETAILEDLIST which give batch numbers related to all items in a particular sales order. we can give sales order no as input and get batches. But I want a function module which returns sales ordrer no and i

  • Workflow Enhancements

    We use HCM F&P and everything works well in the Production system. We plan to make some enhancements to the Form like 1) Changes in Layout, 2) New Fields, 3) Changes in Workflow routing We plan to introduce new container variables which will change w

  • Cannot save work FCP displays "Operation Not Allowed"

    I began working on a new project last week delievered to me as media files and project file on a 500 G. LaCie drive. After working a couple of hours on this project, I began to get a warning box "Operation Not allowed" everytime I tried to save or au