Need to show previous 3months data

Hi
I need to show last 3months data in the report. Currently i am able to do it by creating 3 reporsitory variables - Last 3months,last 2months, last month
Variable created : Select to_char(add_months(sysdate,-3),'Month'),to_char(add_months(sysdate,-2),'Month'),to_char(add_months(sysdate,-1),'Month') from dual
With these variables i have to include filter for current year in my request in answers.But for year 2011 it will create problem as i would need data for both the years but only for previous 3mnths from sysdate.
Appreciate valuable suggestions.

If you are looking for last 3 months data irrespective of year i.e. last 90 days data use the following at report level
date >= timestampadd(sql_tsi_day,-90,current_date).

Similar Messages

  • Need to show Previous months data in report

    Hi All,
    I have a crystal report 2011 which shows monthly Cash data. It has 3 other columns like Previous 3 months cash data, previous 6 months cash data, Previous 12 months cash data in report.
    My report also has two parameters- start date and end date. If I give Start date as 1/1/2012 and end date as 12/31/2013 (two years date range) then correct data comes in all columns and for 2013 year, correct data is coming for Previous 12 months column. But if I give only one month date range like start date as 1/1/2013 and end date as 01/31/2013, then it is not showing correct data for these 3 columns - Previous 3 months cash data, previous 6 months cash data, Previous 12 months cash data. Ideally as per requirement, it should calculate previous months data regardless of parameter values and put data in respective columns.
    Any help/suggestion? Any trick which can help me to show correct data in all columns no matter what date range or months I am taking in parameters.
    Is it mandatory to have previous 12 Months data in report to calculate column-Previous 12 months Cash data?
    Thanks,
    Remi

    Hi Remi,
    You can try like this:
    I have given a some suggestions i.e You just take one parameter only because u can imagine 3 columns previous data display correctly i.e From Date
    Month parameter is also a alternate option.
    For Ex: Column1: From Date - 90 Days/3 Months  - we get the three months previous data correctly etc.
    Finally, create a stored procedure that returns the required columns and does all the calculations on the database side.
    Follow abhilash suggestion as well.
    Useful threads: Crystal Report Parameter Issue
    Pull Last 6 months of data
    Month to date data for Previous month
    How to find current month, previous month Net Sales by means of formula?
    Thanks,
    DJ

  • Need to show No applicable data in the report.

    Hi All,
    We ave a key figure in the selection screen. And user will enter the value. based on the input, the report has to display less than or equal to the entered value as a result in the output of the report.
    Input NIV as 67,169.48 then below results -
    If user gives input NIV as 16,544.14 , the below output is showing.
    But we need to show zero as result or no applicable data in the report. Is it possible to achieve through FORMULA.Please help on this
    Thanks.

    Hi Jalina,
    Yasemin already asked few questions.
    but this is what we may do:-
    to create a formula variable and use it for user input. use this formula variable in a formula , if your NIV kf<= formula variable, then NIV KF, else, 0.
    then make a condition on this KF, not equal to zero to suppress this record.
    regards,
    Sakthi.

  • Adobe Form showing previous records data

    Dear All,
    I have created a wd component consisting of 2 views.
    In the first view i am displaying an ALV. When i select a record and click on the alv button, the second view
    gets called which contains an Adobe Form showing the data.
    The problem i am facing is that the record which gets displayed in the adobe form is the one previous selected record and not the current record which i select.
    Kindly give your valuable suggestions .
    Regards,
    Niti

    this doesn't sound like an adobe issue. you need to set a breakpoint and check which record you're really passing to your interface

  • Plotting dynamic data but plot showing previous acquired data too

    Hi, I am trying to plot a voltage-signal graph simultaneously, as it is being acquired by the computer from the SR830 lock-in amplifier. I have used a X-Y plot and placed it inside the for loop where the data is being acquired. <It only shows me the last point instead of all the points acquired earlier too. I want to retain the earlier data plot as well instead of just the last data point but want to update the graph as the data are acquired sequentially. If I put the x-y plot outside the loop. it will acquire a set of data before plotting which is not desirable in my case, as data has to be plotted dynamically. Can u guys please suggest me a way. Am I doing something wrong? thanks in advance.
    Please find the VI attached. 
    Solved!
    Go to Solution.
    Attachments:
    select voltage freq amp VISA 6.vi ‏67 KB

    Cory K wrote:
    altenbach wrote:
    The "built xy graph" express VI has a "reset?" input. Wire a true to it to reset the internal data. In your particular case do a "=0" on the iteration terminal of the inner for loop and wire it to the reset input.
    Now I'm confused. Does he want to keep the previous data or not?
    He made it sound like he is only getting 1 point in the graph, but he wants to keep all of the data in the graph
    Sorry, my message was incomplete. You need to double-click the "build xy graph" express VI and un-check "clear data on each call".  Easy enough?
    Whenever you want to start over, wire a true to the reset input to clear the history.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    xy.png ‏29 KB

  • Reformatted macintosh HD but still showing previous owners data

    I erased the macintosh HD and reinstalled mountain lion OS on my new-used macbook but, the info and settings from previous user is still there. 
    I think the macintosh HD is an SSD.  Does this fact have any influence with whats going on?  Is there something I'm not doing correctly?
    My objective was to star fresh; as if I was the first or original owner. 

    Yes it will. Use the Online INternet Recovery system. Different from the built in Recovery HD partition.
    Hold down the Command + Option/alt + r keys at startup and keep them held down until you see a globe on the screen.
    Once the Mac OS X Utilities screen comes up select Disk Utility and select the hard drive model number, Top most entry on the left, and then the Partition Tab on the right. In the partition layout drop down, center area, select One Partition. Make it the whole drive with a name of Macintosh HD. In the format area select Mac OS Extended (Journaled) then click the Apply button.
    Once that is done exit DU and select Reinstall Mac OS X.
    Lion will be downloaded and installed.
    NOTE:
    All data on the drive will be erased, files folders and all Apps.

  • How to show a report for 'Previous Month' Data

    Hi Gurus,
    I have a requirement, where i have to default my report to show previous month data.
    Scenario:
    My prompts by Default are set to CURRENT (current year,quarter,month). once the user logs in, the report should display data for month 'Nov' instead of 'Dec'.
    I tried using TIMESTAMPADD() in the formula , but it didn't work, though i don't see any error. Not sure if i 'm missing something.
    Is there a way to achieve this.I 'm using OBIEE 11.1.1.6.
    Any help is highly Appreciated ! Please.
    Thanks,
    Ramya

    From what you wrote I am assuming the user can manually save the report results to the Excel file.
    If your report uses ALV Grid it is possible to export the data to a spreadsheet (one of the functions available in the ALV tool bar).
    If you have used WRITE statements it is also possible to save the output as a spreadsheet (menu System -> List -> Save), but the latter will not produce as nice a spreadsheet if the data don't form a matrix. In other words, some work may be necessary in the spreadsheet afterwards before it has the format your user wants.

  • Sharepoint 2007 - Creating a form to capture timesheets data, but need to track updates to previously submitted data

    Hi,
    We are using a basic version of Sharepoint 2007 and do not have access to InfoPath. I have created a list to allow team members to submit their weekly time on specific activities.  How do I go about tracking any changes to previously submitted data?
    For instance, a team member enters 5 hours for Activity 1 and submits on April 1.  on April 10 they realize they submitted too few hours and want to go in to edit the 5 hours to 12 hours.
    From a reporting perspective we already pulled a report (export to excel) and have the 5 hours listed for April 1. If the user goes in to edit their time sheet from April 1, we don't want the data to just override the 5 hours, we want some sort of flag to
    show the hours went from 5 to 12 hours.  How do we do this?
    As a work around, I added a question at the beginning of the survey/list asking is this a new submission or an edit. I thought if they select edit and were taken to a screen that allowed them to select the date (April 1), the activity and the new hours that
    I would have all of the previous data plus these 3 columns with the additional data: "Edit", "Activity 1", "12".  Instead the original data was over written and all I show are blanks for the previous questions and the edited
    info ("Edit", "Activity 1", "12").
    What suggestions do you have so that I can maintain the integrity of the original data and flag for my Project Manager which data needs to be changed in previous reports.
    Thanks in advance!
    AA

    I think the best way to answer your question would be to create a simple form and try various submissions. Be aware that unless the e-mail system is controlled, e-mail submission is not recommended due to client configuration issues of e-mail. Your question sounds like online submission would already be something you are comfortable with. In that case you can submit form data in 3 different ways: HTML, FDF, or XML. It can also be submitted as a PDF by saving the form, but that does not sound like what you need and also gets into issues of whether folks are using Reader or Acrobat.
    Also be careful (or try both) about using forms from within Acrobat and the forms created by the link in Acrobat to Designer. Once you go to Designer with the form you can not come back for editing in Acrobat. Normally you would create the basic form in a word processor or layout tool and then add the form fields in Acrobat (or Designer if that is preferred).
    I will let others address the anonymous and yet confirmation check issue.

  • Help needed in getting the previous Quarter Data

    Hello folks,
    I have this procedure where i have to modify the current procedure in the following manner:
    I need to get rid of the variables p_start and p_end so that i cannot see them in the crystal report and include the Frequency in the procedure to get the Data based on the Dates.
    and Main requirement is" If the Frequency is Quarterly " it should get the previous quarter Data, if "Frequency is monthly" it should return the previous month data.Can anyone please let me know where shud i make changes. Am including the procedure for refernce. Any help is appreciated
    Thanks a millioin,
    CREATE OR REPLACE PROCEDURE hcsc_recovery_report_h(report_record in out cr_return_types.gen_cursor,
    p_start       string,
    p_end         string)
    IS
    v_startdate date;
    v_enddate date;
    BEGIN
    v_startdate := to_date(p_start, 'YYYY/MM');
    v_enddate := last_day(to_date(p_end, 'YYYY/MM'));
    open report_record for
    select --distinct r.recovery_id
    r.event_id,
    r.event_case_id,
    c.client_id,
    c.client_code,
    c.client_name,
    b.branch_group_code,
    b.branch_group_description,
    g.employer_group_code,
    g.employer_group_name,
    e.client_policy_identifier,
    e.date_of_incident,
    e.event_type_code,
    sum(nvl(r.amount, 0)) as amt_received,
    nvl(sum(case
    when r.amount >= 0 then
    rd.fees
    else
    rd.fees * (-1)
    end),
    0) as fees,
    ec.close_date, *001* commented
    (case
    when ec.close_date <= to_date(to_char(v_enddate, 'MMDDRRRR') || '235959',
    'MMDDRRRR HH24MISS') then
    ec.close_date
    else
    null
    end) as close_date, --*001*  added
    get_case_value(ec.event_id, ec.event_case_id, v_enddate) as case_value,
    nvl(etl.fee_percent_flag, 'N') workmans_comp,
    max(to_char(r.recovery_date, 'FMMonthYYYY')) Year_Month,
    max(to_char(r.recovery_date, 'YYYYMM')) Y_M,
    max(to_date(to_char(r.recovery_date, 'MMYYYY'), 'MM/YYYY')) date_MY
    from recovery r,
    recovery_detail rd,
    event e,
    client c,
    branch_group b,
    employer_group g,
    event_case ec,
    event_type_lookup etl
    where r.event_id = e.event_id
    and r.event_case_id = ec.event_case_id
    and ec.event_id = e.event_id
    and rd.recovery_id(+) = r.recovery_id
    and r.recovery_date between v_startdate and
    to_date(to_char(v_enddate, 'MMDDRRRR') || '235959',
    'MMDDRRRR HH24MISS')
    and e.client_id = c.client_id
    and g.client_id = c.client_id
    and b.client_id = c.client_id
    and g.employer_group_id(+) = e.employer_group_id
    and b.branch_group_id(+) = g.branch_group_id
    and e.event_type_code = etl.event_type_code -- SST 130852 04/14/09
    group by r.event_id,
    r.event_case_id,
    c.client_id,
    c.client_code,
    c.client_name,
    b.branch_group_code,
    b.branch_group_description,
    g.employer_group_code,
    g.employer_group_name,
    e.client_policy_identifier,
    e.date_of_incident,
    e.event_type_code,
    ec.close_date,
    get_case_value(ec.event_id, ec.event_case_id, v_enddate),
    nvl(etl.fee_percent_flag, 'N')
    having sum(nvl(r.amount, 0)) <> 0
    order by c.client_code,
    b.branch_group_code,
    g.employer_group_code,
    r.event_case_id;
    Edited by: user11961230 on Oct 20, 2009 9:02 AM

    user11961230 wrote:
    1. I want to get rid of the p_start and p_end. So how do i declare the v_startdate and v_enddate in the following part?
    v_startdate := to_date(p_start, 'YYYY/MM');
    v_enddate := last_day(to_date(p_end, 'YYYY/MM'));I'm not sure what you mean by "declare".
    In PL/SQL, "declare" means state (at the beginning of a block) that there will be a certain variable with a certain name (such as v_startdate) and datatype (such as DATE). You're already declaring the variables v_startdate and v_enddate correctly, right before the BEGIN statement.
    Declaring a variable is not the same as initializing it, that is, giving it a value for the first time. Your next question seems to be about initializing..
    2. where exactly shud i include the logic that u have mentioned. sorry a dumb questionIn place of the two assignment statments that reference p_start and p_end.
    3. This time am gonna use frequency instead of report_type so that i will get rid of the p_start and p_end from the procedure.Do you mean you want to pass an argument (called frequency) that tells if you want a quarterly or a mionthly report, just like the variable report_type in my example?
    If so, replace report_type in my example with frequency.
    I think you want something like this:
    CREATE OR REPLACE PROCEDURE hcsc_recovery_report_h
    (      report_record         in out     cr_return_types.gen_cursor
    ,      frequency         IN           VARCHAR2
    IS
         -- Declare local variables:
         v_startdate     date;
         v_enddate      date;
    BEGIN
         -- Initialize v_startdate and v_enddate, depending on frequency
         IF  frequency = 'QUARTERLY'
         THEN
              v_startdate := TRUNC ( ADD_MONTHS (SYSDATE, -3)
                                           , 'Q'
              v_enddate := TRUNC (SYSDATE, 'Q');
         ELSIF  frequency = 'MONTHLY'
         THEN
              v_startdate := TRUNC ( ADD_MONTHS (SYSDATE, -1)
                             , 'MM'
              v_enddate := TRUNC (SYSDATE, 'MM');
         END IF;
         --   Subtract one second from v_enddate
              v_enddate := v_enddate - ( 1
                                            / (24 * 60 * 60)
         open report_record for
         select --distinct r.recovery_id
                r.event_id,
         and     r.recovery_date  BETWEEN  v_startdate     
                         AND       v_enddate
         ...When you post formatted text on this site (and code should always be formatted), type these 6 characters:
    (small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
    Edited by: Frank Kulash on Oct 20, 2009 2:37 PM
    Changed query to use BETWEEN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need to show data related to Process order request , BOM in a smart form

    Hi,
    I need to show data related to
    •     Process order request
    •     BoM
    Now in selection screen we are entering the followings.
    Manufacturing  Plant ,MRP Controller, Production scheduler, Order type , Order , Material, Sales order, WBS Element,Release,Scheduled start, Scheduled finish ,Selection profile.
    how to get 1> Process Order number,Produced Material,Material Description,Print date,Narcotics indicator , Quantity produced , Phase number , Phase description ,Resource description,Standard value  to show in a request form.
      2> Item category ,Component code,Component description , Component quantity ,Component Unit of measure ,BoM base quantity.
    Please help me how to get those values , what should be the aaproach , how to write the select quiry.
    Thanks

    Hi
    To get BOM details, do the following:
    1. Use the material number and goto Article to BOM link table (MAST) to get STLNR (BOM).
    2. With this STLNR, goto STPO table (where STLNR is the key field).  Here you will get all the BOM details like components (IDNRK), UoM (MEINS) etc....
    Hope this helps.
    THanks
    Vijay
    <b>PLZ REWARD POINTS IF HELPFUL</b>

  • Need to show a data in weeks for stacked column

      I need to show the data broken down in weeks if you choose the start date and end date.   I have to show in a stacked column chart. I am trying to show the values if you choose for example last month i need to show it by weeks for example 
    week    user name   total approved first approved    last aprovedDate  totalitemsAdded
    week 1   XYZ                 3                10/01/2012       10/05/2012         5
    week2   XYZ                  5                 etc                      etc            
      etc
    week 3 
    Below is the code and the result  i am getting now . 
    Current Results
    UserName TotalApproved
    FirstApprovedDate LastApprovedDate
       TotalItemsAdded
    XYZ            9
               2011-11-19 16:56:49.960
         2011-11-19 18:18:20.783
                   2
    DECLARE @StartDate DATETIME
    DECLARE @EndDate DATETIME
    SET @StartDate = '10/1/2012 '
    SET @EndDate = '10/31/2012'
    ;with Items as(
           SELECT
                  UserName = Profile.Description,
                  TotalItems = COUNT(TransactionID),
                  FirstAddedDate = MIN(UTCDate),
                  LastAddedDate = MAX(UTCDate)
           FROM Transactiondatabase.dbo.transaction
                    JOIN Biography.dbo.Profile ON transaction.ProfileId = Profile.ProfileID
           WHERE 
                  Data like '%ItemAdded%'
                    AND UTCDate BETWEEN @StartDate AND DATEADD(dd,1,@EndDate)
           GROUP BY
                  Profile.Description 
    Approved as
           SELECT 
                  UserName = Profile.Description,
                  TotalApproved = COUNT(TransactionID),
                  FirstApprovedDate = MIN(UTCDate),--Demo
                  LastApprovedDate = MAX(UTCDate)                 
           FROM Transactiondatabase..transaction
                    JOIN Biography.dbo.Profile ON transaction.ProfileId = Profile.ProfileID
           WHERE 
                  Data like '%Approved%'
                    AND UTCDate BETWEEN @StartDate AND DATEADD(dd,1,@EndDate)
           GROUP BY
                    Profile.Description
    Select Distinct Approved.*, TotalItemssAdded = sum(distinct Items.TotalItems)
    from Items, Approved  
    Group by Approved.UserName, Approved.FirstApprovedDate, Approved.LastApprovedDate, Approved.TotalApproved
    using ssrs 2005 

    Hi Sunny04,
    If I understand correctly, you want to display the data by weeks in a stacked column chart. If in this case, we can add a calculated field named week to display the week name, and then group it. For more details, please see the following steps:
    Right-click the dataset to add a calculated field with the values below:
    Name: Week
    Calculated field: =DatePart(DateInterval.WeekOfYear,Fields!FirstApprovedDate.Value,0,0)
    Add Week field to category group area in a stacked column chart.
    Right-click Week field to open the Properties dialog box, modify the expression of Label to like this:
    ="week"&Fields!Week.Value
    Add TotalApproved or TotalItemsAdded field to data area in the chart.
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Is there a way to show the end dates of the previous month stand out?

    is there a way to show the end dates of the previous month in bold or make it stand out? so 30,31 and 1st of this month don't all look the same? For example the 30,31st get a regular text since they are a part of the the last month and this month gets bold dates? Its hard to read the dates anyways.

    Pics and more
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.
    5:05 PM Sunday; January 4, 2009

  • Showing yesterday's data in SSRS

    Hi Guys,
    I need some help with an expression for SSRS. I need to get only the data for the last date in the query . I just want the previous date information whereas on Monday, it's going to be Friday's information.
    I tried with this as a test but is not working.
    =IIF(Fields!OpenDate.Value >= DateAdd("d",-1,today),COUNT(Fields!InFxO.Value), 0)
    I need it for to create a dashboard and show yesterday's factory output.
    Thanks

    Hi Eric1000,
    According to your description, you want to count the number of InFxO values when OpenDate is prior to the current day.
    In this case, we can use IIF function returns value of InFxO depending on whether OpenDate is before today, then use Count function returns a count of non-null values specified by the expression, evaluated in the context of the given scope. Please refer
    to the expression like below:
    =Count(IIf(Fields!OpenDate.Value < Today(), Fields!InFxO.Value, Nothing))
    Besides, Sum function returns the sum of all the non-null numeric values specified by the expression, evaluated in the given scope. We can also use Sum function to implement the function like below:
    =Sum(IIf(Fields!OpenDate.Value <Today(), 1,0))
    If there is any misunderstanding , please feel free to let me know.
    Best Regards,
    Wendy Fu

  • Aging Query show Previous Bucket

    Hi All,
    Working ERP Version 11.5.10.2
    I need some help, in my query to show previous bucket from as of date.
    please see the below query
    select TRX_NUMBER,salesper_name, customer_name, customer_number,amount_due_original,
    amount_due_remaining,gl_date,amount_remaining, SALESREP_ID , due_date,
    SUM( CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE)-due_date,0) < 1 THEN amount_remaining ELSE 0 END ) current_buck,
    SUM( CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE)-due_date,0) BETWEEN 1 AND 30 THEN amount_remaining ELSE 0 END ) buck1,
    SUM( CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE)-due_date,0) BETWEEN 31 AND 60 THEN amount_remaining ELSE 0 END ) buck2,
    SUM( CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE)-due_date,0) BETWEEN 61 AND 90 THEN amount_remaining ELSE 0 END ) buck3,
    SUM( CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE)-due_date,0) BETWEEN 91 AND 180 THEN amount_remaining ELSE 0 END ) buck4,
    SUM( CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE)-due_date,0) BETWEEN 181 AND 270 THEN amount_remaining ELSE 0 END ) buck6,
    SUM( CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE)-due_date,0) BETWEEN 271 AND 360 THEN amount_remaining ELSE 0 END ) buck5,
    SUM( CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE)-due_date,0) >= 361 THEN amount_remaining ELSE 0 END ) buck7
    from (SELECT aps.TRX_NUMBER, rs.NAME salesper_name,
    ac.customer_name, ac.customer_number, aps.amount_due_original,
    aps.amount_due_remaining, aps.gl_date,
    --SUM (  aps.amount_due_remaining
    SUM (decode(aps.invoice_currency_code,'SAR',aps.amount_due_remaining,(aps.amount_due_remaining*aps.exchange_rate))
    + (SELECT nvl(SUM (NVL (arav.AMOUNT_APPLIED, 0)),0)
    FROM ar_receivable_applications_v arav
    WHERE arav.GL_DATE > nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),sysdate)
    AND arav.TRX_NUMBER= aps.TRX_NUMBER
    AND aps.CLASS = 'INV'
    AND arav.CUSTOMER_ID= aps.CUSTOMER_ID
    + (select nvl(SUM (NVL (acma.AMOUNT_APPLIED_BASE , 0)),0) from ARBV_CREDIT_MEMO_APPLICATIONS acma, ra_customer_trx_partial_v rctpv1
    where acma.APPLIED_PAYMENT_SCHEDULE_ID=aps.PAYMENT_SCHEDULE_ID
    and rctpv1.CUSTOMER_TRX_ID=acma.CUSTOMER_TRX_ID
    and rctpv1.GD_GL_DATE > nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),sysdate) )
    +(select nvl(SUM(adj.amount),0) -- for manuval credit note
    from ar_app_adj_v adj , ra_customer_trx_all rac
    where adj.customer_trx_id = aps.CUSTOMER_TRX_ID
    and adj.GL_DATE > nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),sysdate)
    and adj.ps_class in ('CM','DM')
    and aps.customer_trx_id = rac.customer_trx_id
    and rac.trx_number not in('706575','PO19793/INV#25013#1') )
    + (SELECT nvl(SUM (NVL (arav.amount_applied, 0))*-1,0)
    FROM ar_receivable_applications_v arav
    WHERE arav.GL_DATE > TO_DATE (:p_to_date, 'RRRR/MM/DD HH24:MI:SS')
    AND arav.CUSTOMER_ID =aps.CUSTOMER_ID
    AND arav.CASH_RECEIPT_ID =aps.CASH_RECEIPT_ID
    AND arav.RECEIPT_NUMBER=aps.TRX_NUMBER
    AND aps.CLASS = 'PMT'
    AND aps.GL_DATE_CLOSED > TO_DATE (:p_to_date, 'RRRR/MM/DD HH24:MI:SS')
    )) amount_remaining
    ,RS.SALESREP_ID
    ,aps.due_date
    FROM ar_payment_schedules aps, ra_customers ac,
    ar_lookups look,
    ar_lookups look_status,
    hz_cust_accounts cust,
    hz_parties party,
    hz_cust_site_uses site_uses,
    hz_cust_acct_sites acct_site,
    hz_party_sites party_site,
    hz_locations loc,
    ra_salesreps rs
    WHERE aps.gl_date <=
    NVL (TO_DATE (:p_to_date, 'RRRR/MM/DD HH24:MI:SS'), SYSDATE)
    AND cust.cust_account_id = acct_site.cust_account_id
    AND cust.party_id = party.party_id
    AND acct_site.party_site_id = party_site.party_site_id(+)
    AND loc.location_id(+) = party_site.location_id
    AND acct_site.cust_acct_site_id = site_uses.cust_acct_site_id(+)
    AND look.lookup_type(+) = 'SITE_USE_CODE'
    AND look.lookup_code(+) = site_uses.site_use_code
    AND look_status.lookup_type(+) = 'CODE_STATUS'
    AND look_status.lookup_code(+) = NVL (cust.status, 'A')
    AND SUBSTRB (look.meaning, 1, 8)= 'Bill To'
    AND site_uses.PRIMARY_SALESREP_ID=rs.SALESREP_ID
    AND rs.NAME = nvl(:p_sale_per,rs.NAME)
    AND ac.CUSTOMER_NUMBER=cust.ACCOUNT_NUMBER
    AND aps.CUSTOMER_ID=ac.CUSTOMER_ID
    AND aps.CUSTOMER_SITE_USE_ID=site_uses.SITE_USE_ID
    GROUP BY rs.NAME,ac.customer_name,
    ac.customer_number,
    aps.amount_due_original,
    aps.amount_due_remaining,
    aps.gl_date,
    aps.trx_number
    ,rs.SALESREP_ID , aps.due_date
    ORDER BY rs.NAME)
    group by TRX_NUMBER, salesper_name,customer_name, customer_number,amount_due_original,
    amount_due_remaining,gl_date,amount_remaining, SALESREP_ID, due_date
    Regards

    Maybe
    select TRX_NUMBER,salesper_name,customer_name,customer_number,amount_due_original,
           amount_due_remaining,gl_date,amount_remaining,SALESREP_ID,due_date,
           SUM(CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE) - due_date,0) < -30
                    THEN amount_remaining
                    ELSE 0
               END) previous_buck,
           SUM(CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE) - due_date,0) BETWEEN 0 AND -30
                    THEN amount_remaining
                    ELSE 0
               END) current_buck,
           SUM(CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE) - due_date,0) BETWEEN 1 AND 30
                    THEN amount_remaining
                    ELSE 0
               END) buck1,
           SUM(CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE) - due_date,0) BETWEEN 31 AND 60
                    THEN amount_remaining
                    ELSE 0
               END) buck2,
           SUM(CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE) - due_date,0) BETWEEN 61 AND 90
                    THEN amount_remaining
                    ELSE 0
               END) buck3,
           SUM(CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE) - due_date,0) BETWEEN 91 AND 180
                    THEN amount_remaining
                    ELSE 0
               END) buck4,
           SUM(CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE) - due_date,0) BETWEEN 181 AND 270
                    THEN amount_remaining
                    ELSE 0
               END) buck6,
           SUM(CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE) - due_date,0) BETWEEN 271 AND 360
                    THEN amount_remaining
                    ELSE 0
               END) buck5,
           SUM(CASE WHEN ROUND(nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),SYSDATE) - due_date,0) >= 361
                    THEN amount_remaining
                    ELSE 0
               END) buck7
      from (SELECT aps.TRX_NUMBER,rs.NAME salesper_name,ac.customer_name, ac.customer_number, aps.amount_due_original,
                   aps.amount_due_remaining, aps.gl_date,
                   SUM(decode(aps.invoice_currency_code,'SAR',aps.amount_due_remaining,(aps.amount_due_remaining * aps.exchange_rate)) +
                       (SELECT nvl(SUM(NVL(arav.AMOUNT_APPLIED,0)),0)
                          FROM ar_receivable_applications_v arav
                         WHERE arav.GL_DATE > nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),sysdate)
                           AND arav.TRX_NUMBER = aps.TRX_NUMBER
                           AND aps.CLASS = 'INV'
                           AND arav.CUSTOMER_ID = aps.CUSTOMER_ID
                       ) +
                       (select nvl(SUM(NVL(acma.AMOUNT_APPLIED_BASE,0)),0)
                          from ARBV_CREDIT_MEMO_APPLICATIONS acma,
                               ra_customer_trx_partial_v rctpv1
                         where acma.APPLIED_PAYMENT_SCHEDULE_ID=aps.PAYMENT_SCHEDULE_ID
                           and rctpv1.CUSTOMER_TRX_ID = acma.CUSTOMER_TRX_ID
                           and rctpv1.GD_GL_DATE > nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),sysdate)
                       ) +
                       (select nvl(SUM(adj.amount),0) -- for manuval credit note
                          from ar_app_adj_v adj,
                               ra_customer_trx_all rac
                         where adj.customer_trx_id = aps.CUSTOMER_TRX_ID
                           and adj.GL_DATE > nvl(to_date(:P_TO_DATE,'RRRR/MM/DD HH24:MI:SS'),sysdate)
                           and adj.ps_class in ('CM','DM')
                           and aps.customer_trx_id = rac.customer_trx_id
                           and rac.trx_number not in('706575','PO19793/INV#25013#1')
                       ) +
                       (SELECT nvl(SUM(NVL(arav.amount_applied, 0))*-1,0)
                          FROM ar_receivable_applications_v arav
                         WHERE arav.GL_DATE > TO_DATE(:p_to_date,'RRRR/MM/DD HH24:MI:SS')
                           AND arav.CUSTOMER_ID = aps.CUSTOMER_ID
                           AND arav.CASH_RECEIPT_ID = aps.CASH_RECEIPT_ID
                           AND arav.RECEIPT_NUMBER = aps.TRX_NUMBER
                           AND aps.CLASS = 'PMT'
                           AND aps.GL_DATE_CLOSED > TO_DATE(:p_to_date,'RRRR/MM/DD HH24:MI:SS')
                      ) amount_remaining,
                      RS.SALESREP_ID,
                      aps.due_date
                 FROM ar_payment_schedules aps,
                      ra_customers ac,
                      ar_lookups look,
                      ar_lookups look_status,
                      hz_cust_accounts cust,
                      hz_parties party,
                      hz_cust_site_uses site_uses,
                      hz_cust_acct_sites acct_site,
                      hz_party_sites party_site,
                      hz_locations loc,
                      ra_salesreps rs
                WHERE aps.gl_date <= NVL(TO_DATE(:p_to_date,'RRRR/MM/DD HH24:MI:SS'),SYSDATE)
                  AND cust.cust_account_id = acct_site.cust_account_id
                  AND cust.party_id = party.party_id
                  AND acct_site.party_site_id = party_site.party_site_id(+)
                  AND loc.location_id(+) = party_site.location_id
                  AND acct_site.cust_acct_site_id = site_uses.cust_acct_site_id(+)
                  AND look.lookup_type(+) = 'SITE_USE_CODE'
                  AND look.lookup_code(+) = site_uses.site_use_code
                  AND look_status.lookup_type(+) = 'CODE_STATUS'
                  AND look_status.lookup_code(+) = NVL (cust.status, 'A')
                  AND SUBSTRB (look.meaning, 1, 8)= 'Bill To'
                  AND site_uses.PRIMARY_SALESREP_ID=rs.SALESREP_ID
                  AND rs.NAME = nvl(:p_sale_per,rs.NAME)
                  AND ac.CUSTOMER_NUMBER=cust.ACCOUNT_NUMBER
                  AND aps.CUSTOMER_ID=ac.CUSTOMER_ID
                  AND aps.CUSTOMER_SITE_USE_ID=site_uses.SITE_USE_ID
                GROUP BY rs.NAME,ac.customer_name,ac.customer_number,aps.amount_due_original,aps.amount_due_remaining,
                         aps.gl_date,aps.trx_number,rs.SALESREP_ID,aps.due_date
                ORDER BY rs.NAME
    group by TRX_NUMBER,salesper_name,customer_name,customer_number,amount_due_original,
              amount_due_remaining,gl_date,amount_remaining,SALESREP_ID,due_dateRegards
    Etbin

  • Previous weeks data

    Hi all,
    I have a requirement where I need to show the Unbilled amount of this week as well as last 20 weeks based on region. Let say I am on fiscal week 20. Now if create a report based on region and Unbilled amount I will get $ 20 for europe. Now if after one week i.e FW 21 , I run the same report I get & 25 for Europe. Again let say after one more week i.e FW 22 I get $ 27 for Europe.
    Now user if run a report on FW 22. he wants areport like
    Week   Region  Unbilled
    FW20   Europe  $20
    FW21   Europe  $25
    FW22 Europe    $27
    i.e history data is required . As data is changing every day , user wants to see previous 20 weeks data.
    Now I am using a Zcube built on standard extarctor 0FI_GL_4. i dont have loading date or system date.
    Please suggest what to do
    Regards,
    Sunny

    Hi.
    If your object fiscal week restricted by variable you should do the next:
    1. create 20 calculated KF each one restricted with this variable with appropriate offset (lets say previous week wth vriable and offset -1, 2 weeks ago with variable and offset -2 ...)
    2. create another calculated KF with variable without offset to represent user selection week.
    So at the end you will see one KF with current week and 20 another KF with 20 previous weeks.
    Regards.

Maybe you are looking for

  • Help on formula Veriable

    I have a key figure "Net Price" is an Attribute of one InfoObject "Material Price". I have created a formula variable with replacement path processing type, Replacement path as "Material Price" with Attribute Value as"Net Price".And also I'm maintain

  • Related OA Framework

    Hi All, Presently, I am working in OA Framework and I am new to this Framework.Firstly I am going to complete the documentation which they provided in Jdeveloper IDE. I completed HelloWorld example with successfully,but in Search Exercise, I am unabl

  • Best Way to Export Tracks

    Hello, What is the easiest way to export tracks so I can bring into another program (that doesn't have OMF capability). I don't want to have to do a process that takes alot of time. Any ideas wiould be appreciated. Regards, Rich

  • Flash 10 movie cannot Firefox 3

    Hello All, my web site http://www.aykandogac.com/ada/index.html to top menu is flash but cannot play Firefox 3. ie and chrome is ok. but firefox 3 is not runnig. please look my flash code. thank you all..

  • How does iPhoto Save photos from multiple Cameras

    I have had a Mac for about 18 months. I have a Canon Digital Elph 410. Because I had only photos from this one camera I never have worried about naming. So all my photos are sequentially numbered IMG_0031, IMG_0032 etc. This last weekend, for a big t