RUNNING TOTAL IN REPORTS

Hi,
Can any one tell me how to create a running total in Oracle reports. I have two fields pulled in the SQL called CR and DR. I want to do the running total at report level. Here what I want
CR------DR-------RTOTAL
20-----10---------10 ( here the RTOTAL Field is (20 - 10) )
30-----15---------25 ( here the RTOTAL Field is (30 - 15) + 10)
50-----25---------50 ( here the RTOTAL Field is (50 - 25) + 25)
75-----35---------90 ( here the RTOTAL Field is (75 - 35) + 50)
Thanks
-Feroz

Hello,
You can use the following SQL query :
select cr,dr,cr-dr cr_minus_dr from <table> ...
and create a Summary Column in the Reports :
Source : the field cr_minus_dr
Function : Sum
Regards

Similar Messages

  • Running total in report footer returning inaccurate result

    Post Author: smarkta
    CA Forum: Formula
    I am writing a report that contains 3 groups.  I have created running totals for each group that are accurate by selecting the group to evaluate and reset on.  now I need to basically sum the results of the all the group running totals but have had no success.  any tips on how to do this would be greatly appreciated.
    Thanks

    Post Author: Charliy
    CA Forum: Formula
    Were you doing a Distinct Count?  Did you have a formula on the Running Total?  What is there about the Group Totals that make them different than the final total.

  • Associate a record name with a running total in Report Footer

    Please Help!
    I have a report that returns records for the most recent order recieved by vendor.
    The page header displays Vendor, Contact, Order #, and date
    I did a group by Vendor
    I used a running total on the order date
    with a summary of minimum
    that evaluates on change of group
    Reset never
    This returns the last order date for the vendor with the oldest order
    How can I get the vendors name that is associated with the oldest order date to display in the Rport Footer.

    Please follow the following steps: I tested it and it works.You dont need to use running total.
    1. Add the Vendor,Contact,Order #, Order Date to Details Section (u can delete them if not needed from details section)
    2. Create a Group on Vendor.
    3. Add a Summary  i.e. Minimum(Order Date)
    4. Copy this summary to Group Header if you want or just let it be in the Group Footer Section
    5. Add a SubReport in the Report Footer Section.
    6.The Subreport Should be based on the Command like:
    SELECT `Orders`.`Customer ID`, `Orders`.`Order Date`
    FROM   `Orders` `Orders`
    WHERE `Orders`.`Order Date`=
    SELECT MIN(`Orders`.`Order Date`) 
    FROM  `Orders` `Orders`)
    7. Refresh the Report and you will see that Report Footer section displays all the vendors with minimum order date along with their name.
    One more thing to keep in mind is that more than one vendor might have the same minimum order date.

  • RUNNING TOTAL

    Hi,
    Can any one tell me how to create a running total in Oracle reports. I have two fields pulled in the SQL called CR and DR. I want to do the running total at report level. Here what I want
    CR------DR-------RTOTAL
    20-----10---------10 ( here the RTOTAL Field is (20 - 10) )
    30-----15---------25 ( here the RTOTAL Field is (30 - 15) + 10)
    50-----25---------50 ( here the RTOTAL Field is (50 - 25) + 25)
    75-----35---------90 ( here the RTOTAL Field is (75 - 35) + 50)
    Thanks
    -Feroz

    Hi Bernd ,
    I tried this and here is the result.
    Query :
    SELECT MAIN_AC_CODE, JV_NO_T, JV_DATE_T, JV_DR_AMT, JV_CR_AMT, SUM(JV_DR_AMT - JV_CR_AMT) OVER ( PARTITION BY MAIN_AC_CODE ORDER BY MAIN_AC_CODE,JV_NO_T) RUNNING_TOTAL
    FROM FIN_JV_T WHERE MAIN_AC_CODE = 1102071001
    ORDER BY MAIN_AC_CODE, JV_NO_T , JV_DATE_T
    output :
    MAIN_AC_CODE     JV_NO     JV_DATE     DR_AMT      CR_AMT     RUNNING_TOTAL
    1102071001      JV1      05-JUL-06 6000      0           -11650
    1102071001      JV1      05-JUL-06 0           17650      -11650
    1102071001      JV13      15-JUL-06 15000      0           12750
    1102071001      JV13      15-JUL-06 30000      0           12750
    1102071001      JV13      15-JUL-06 7000      0           12750
    1102071001      JV13      15-JUL-06 0           30200      12750
    1102071001      JV13      15-JUL-06 1500      0           12750
    1102071001      JV13      15-JUL-06 1100      0           12750
    1102071001      JV14      16-JUL-06 1100      0           16358
    1102071001      JV14      16-JUL-06 2508      0           16358
    1102071001      JV15      16-JUL-06 3609      0           19872
    1102071001      JV15      16-JUL-06 0      95      19872
    1102071001      JV16      16-JUL-06 0      3608      16264
    1102071001      JV19      17-JUL-06      17000 0           -6668
    1102071001      JV19      17-JUL-06 0           22932      -6668
    1102071001      JV2      05-JUL-06      84000      0           18213
    1102071001      JV2      05-JUL-06 0           59119      18213
    1102071001      JV20      17-JUL-06 0           13000      5213
    1102071001      JV21      17-JUL-06 0      4000      1213
    1102071001      JV4      05-JUL-06      28134      0           -31786.57
    1102071001      JV4      05-JUL-06 0           61133.57      -31786.57
    1102071001      JV5      05-JUL-06 0      2970      -34756.57
    1102071001      JV7      05-JUL-06 5500      0           -29256.57
    1102071001      JV8      09-JUL-06 12500      0           -39147.57
    1102071001      JV8      09-JUL-06 0           22391      -39147.57
    1102071001      JV9      12-JUL-06 6740      0           -45107.57
    1102071001      JV9      12-JUL-06 0           12700      -45107.57

  • Item Transaction History Report - Calculation for creating 'Running Total'

    Hello
    Using Oracle Discoverer, we have written a report that pulls back all Inventory Transactions (by item number). This report lists both transactions IN (e.g. receipts into the store) and OUT (e.g. issues out from the store).
    Our customer would like an additional column, to represent 'Running Total', to be added to the report. This column needs to capture the running 'On Hand Quantity' for the associated Item, as each transaction (both transactions IN and OUT of store) is displayed.
    For example, if the initial/first transaction for an item was a Receipt of 500, then this column (on the first line) should display 500. If the second transaction for the item was an issue of 15, then this column (on the second line) should display 485. If the third transaction was for an issue of 50, then this column (on the third line) should display 435. If the fourth transaction was for a receipt of 20, then this column (on the fourth line) should display 455 etc etc
    I'm not sure how I'd write a calculation to cater for this (within discoverer) - do you know if this is achievable? Any help would be much appreciated. This would be easy enough to do in Excel, but I'm a bit of a novice when it comes to discoverer(!)
    Many thanks
    Ross

    Hi,
    You can generally do this type of calculation using analytic functions. You would partition by the item number and order by the transaction date in the analytic function. You can use SUM function (with an order by) to get a running total of a column in the report. You can SUM a calculation containing a CASE statement which changes the OUT transactions to a negative number. The SUM function will start at zero, so you then can use FIRST_VALUE function to get the first value for the item which you could then add to the totals.
    Rod West

  • Showing  running totals on AR statatement Report

    Hi All I need assistance in populating the Running totals on AR statement Report  , I am trying to calculate the running total on the RDF using the (sum Over Partition ) and Not on the RTF template please assist .
    here is my query below :
    select customers.customer_name,
      detail.customer_id,
      detail.customer_site_use_id,
    :CP_ACC_NAME,
    :CP_ACC_NUM,
    :CP_BRNCH_NAME,
    :CP_COL_EMAIL,
    :CP_COL_PHONE,
    :CP_BRANCH_NR,
    decode(  (select meaning
    from ar_lookups
    where lookup_type = 'INV/CM/ADJ' and lookup_code =  detail.class), 'Payment', apply_date, trx.trx_date)  TRX_DATE,
    trx.INVOICE_CURRENCY_CODE,
    trx.INVOICE_CURRENCY_CODE INVOICE_CURRENCY_CODE_BAL,
    NVL(trx.term_due_date,trx.TRX_DATE)  term_due_date,
    detail.customer_id cst_id,
      detail.customer_site_use_id cst_site_id,
      detail.customer_trx_id,
      detail.trx_number,
       (select meaning
    from ar_lookups
    where lookup_type = 'INV/CM/ADJ' and lookup_code =  detail.class) class,
      detail.amount_full_original,
      detail.end_bal * -1 , (detail.end_bal + detail.amount_full_original)* -1  closing_balance ,
    detail.amount_full_original -  detail.the_order * -1  closing_bal,
      (detail.amount_full_original - detail.running_total) running_total ,
      detail.running_tot ,
      customers.customer_name address1,
      customers.address1 address2,
      customers.address2 address3,
      customers.address3 address4,
      customers.city||' '||customers.state address5,
      customers.country||' '||customers.postal_code address6,
      addr.address1 rm_address1,
      addr.address2 rm_address2,
      addr.address3 rm_address3,
      addr.address4 rm_address4,
      addr.address5 rm_address4,
       :p_as_of_date_from date_from,
       to_char(to_date(:p_as_of_date_to,'DD-MON-YYYY'),'DD-Mon-YYYY') date_to,
      addr.org_id rm_org_id,
       rtrim(to_char(sysdate,'DD')||' '||to_char(sysdate,'Month'))||' '||to_char(sysdate, 'YYYY') curr_date
    from (select customer_id, CUSTOMER_SITE_USE_ID, trx.CUSTOMER_TRX_ID,trx.TRX_NUMBER, null apply_date,ps.class,ps.AMOUNT_DUE_ORIGINAL amount_full_original, the_trx.end_bal,the_trx.running_total , the_trx.running_tot , 1 the_order
    select customer_trx_id, sum(acctd_end_bal) end_bal  , running_total  ,  running_tot
    SELECT ps.customer_trx_id ,
       sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
       NULL,to_date(:p_as_of_date_from))
      * ps.amount_due_remaining) start_bal,
       sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
       NULL,to_date(:p_as_of_date_to))
      * ps.amount_due_remaining) end_bal,
       sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
       NULL,to_date(:p_as_of_date_from))
      * ps.acctd_amount_due_remaining) acctd_start_bal,
       sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
       NULL,to_date(:p_as_of_date_to))
      * ps.acctd_amount_due_remaining) acctd_end_bal ,
       (sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
       NULL,to_date(:p_as_of_date_from))
      * ps.amount_due_remaining) + sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
       NULL,to_date(:p_as_of_date_to))
      * ps.acctd_amount_due_remaining) ) running_total ,  
       sum((sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
       NULL,to_date(:p_as_of_date_from))
      * ps.amount_due_remaining) + sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
       NULL,to_date(:p_as_of_date_to))
      * ps.acctd_amount_due_remaining) )) over (partition by ps.customer_trx_id  order by ps.customer_trx_id)running_tot
       FROM ar_payment_schedules_all ps
       WHERE ps.payment_schedule_id+0 > 0
       --JF2 AND ps.gl_date_closed >= to_date(:p_as_of_date_from)
       AND  ps.class IN ( 'CB', 'CM','DEP','DM','GUAR','INV')
       AND  ps.gl_date  <= to_date(:p_as_of_date_to)
       and org_id = nvl(:P_ORG_ID,org_id)--1246
       --and customer_id = :p_customer_id --1075
       --and CUSTOMER_SITE_USE_ID = :p_customer_site_id --1066
       --and customer_trx_id = 66291
       --'|| l_ps_org_where ||'
       GROUP BY ps.customer_trx_id ,ps.acctd_amount_due_remaining , ps.gl_date,ps.gl_date_closed ,ps.class , rownum 
      ps.customer_trx_id ,
       sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
      ra.gl_date,to_date(:p_as_of_date_from))
      * ( ra.amount_applied  + NVL(ra.earned_discount_taken,0)
       + NVL(ra.unearned_discount_taken,0))) start_bal,
       sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
      ra.gl_date,to_date(:p_as_of_date_to))
      * ( ra.amount_applied  + NVL(ra.earned_discount_taken,0)
       + NVL(ra.unearned_discount_taken

    Hi
    Yes i would like more help as i have never used group by roll up before
    SELECT p.employee_number,
    p.full_name employee_name,
    DECODE (p.sex, 'M', 'Male', 'F', 'Female') gender,
    (DECODE (p.per_information4,
    '01', 'Indian',
    '02', 'African',
    '03', 'Coloured',
    '04', 'White')) race,
    p.original_date_of_hire,
    a.effective_start_date startdate_current_position,
    RTRIM (SUBSTR (ps.NAME, 1, INSTR (ps.NAME, ';')), ';') current_position,
    ho.NAME current_organization,
    xx_return_company_name(a.person_id, a.effective_start_date) current_company,
    RTRIM (SUBSTR (ps1.NAME, 1, INSTR (ps1.NAME, ';')),';') previous_position,
    ho1.NAME previous_organization,
    xx_return_company_name(a1.person_id, a1.effective_start_date) previous_company,
    a1.effective_start_date startdate_prev_position
    FROM per_assignments_v2 a,
    per_assignments_v2 a1,
    per_all_people_f p,
    per_all_positions ps,
    per_all_positions ps1,
    hr_all_organization_units_tl ho,
    hr_all_organization_units_tl ho1
    WHERE a1.person_id = a.person_id
    AND NVL (a1.position_id, 9) <> a.position_id
    AND a1.effective_end_date = a.effective_start_date - 1
    AND p.person_id = a.person_id
    and ho.ORGANIZATION_ID=ps.ORGANIZATION_ID
    and ho1.ORGANIZATION_ID=a1.ORGANIZATION_ID
    AND a.effective_start_date BETWEEN p.effective_start_date AND p.effective_end_date
    AND a.position_id = ps.position_id
    and p.EMPLOYEE_NUMBER not in ('1','2','3')
    AND a1.position_id = ps1.position_id(+)
    order by p.full_name

  • Oracle report running total Resseting balance

    Dear All,
    I am developing report on Oracle R12 fixed Assets, I have to calculate the running total for each asset.
    In brief
    Asset 1
    cost Deprciation Adjusted Cost
    50 - 2 48
    48 -5 45
    45 - 4 41
    I achieved that by using
    if :p_val is null then
    :result := nvl(:cost,0)-nvl(:depriciation,0);
    :P_val :='5';
    return :result;
    else
    :result := nvl(:result,0)-nvl(:depriciation,0) ;
    return :result;
    end if;
    working fine
    But problem is when the next asset start on same report
    Asset 2
    cost Deprciation Adjusted Cost
    100 5 36
    it substracts the last total (running total of previous asset with depriciation which was 41 in this example).
    Oracle Champs pl advice me how to solve this.
    I really dont got any idea how to solve this.
    thanks

    Dear,
    Thanks for your reply , in your reply what you said I tried this but in pl/sql I am not actually achieving the result. The balance is not resetting at next group if you give one accurate line it would be really helpfull.
    thanks

  • Need to sum hh:mm:ss in crystal report using Running Total Fields

    Hello,
    I am new to .Net and crystal reports so please go easy on me.
    I am trying to develop a crystal report using Visual Basic .NET. I have a column which displays the "Inbound Time" in "hh:mm:ss" format. I have to sum the total inbound time and display it.
    I tried using the Running Total and i am not successful.
    Here is the code which I am using in the Running total
    WhilePrintingRecords;
    if isNumeric({Report3;1.TotalInboundTime}) then
    {Report3;1.TotalInboundTime}
    else
    CStr ({Report3;1.TotalInboundTime});
    NumberVar array test2 := [ToNumber(left(CStr({Report3;1.TotalInboundTime}),2)),ToNumber(mid(Cstr({Report3;1.TotalInboundTime}),4,2)),ToNumber(right(Cstr({Report3;1.TotalInboundTime}),2))];
    StringVar test1 := CStr( (ToNumber(test2[1])3600)+(ToNumber(test2[2])60)+(ToNumber(test2[3])));
    InboundTime is the time field which is in "hh:mm:ss"  format.

    Hello Bharathi,
    There are a couple of KBs about this. I haven't tested them myself, but you could give them a try:
    [How sum multiple time fields in Crystal Reports|http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2008378]
    [Creating a running total to show the difference between two datetime fields |http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2010261]
    [Totalling time values that are stored as numbers in the database|http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2005576]
    Cheers,
    Fritz

  • Crystal reports - charting a variable to simulate a running total

    I have 2 sets of data as below :
    units
    costs
    What I am trying to do is generate a chart that for each month, reports the result of the formula
    sum of costs to date / sum of units to date
    Ideally, I would create 2 running totals
    RT costs
    RT units
    then a formula avg. cost to date = RT costs/ RT units
    and then for each month (x axis of the chart) plot avg/ cost to date
    BUT - crystal won't plot a data set based on running totals.
    So, I created a field with a psudo running total
    i.e.
    whileprintingrecords;
    numbervar unitsum;
    unitsum:=unitsum+units
    and similar for the costs.  Variable called costsum.
    Then a variable field
    whileprintingrecords;
    numbervar results;
    results:=costsum/unitsum
    So I though I could then plot the field with the variable results in it in the chart.  But no, I cannot see the field name in the data select list.
    Please advise how I can create my chart.
    Thanks
    Edited by: newbyr on Jul 7, 2010 12:20 PM

    With the best will in the world, I realise that charting does not like running totals,  What I am looking for is a workaround, or clever way of circumventing the problem.
    Before posting I did extensively search the forum and saw the link that DebiHerbert has suggested, and it is of no help at all.
    Thanks
    Edited by: newbyr on Jul 9, 2010 2:40 PM

  • Running Total Issue or Possibly Formula Issue in Crystal Reports 9

    Post Author: Jeffs23
    CA Forum: Formula
    My issue involves two formula's - @TotalTime and @Converted Time and a Running Total (RTotal0).
    @TotalTime{Data.ApptTime}/60@Converted Timenumbervar x := {#RTotal0};totext(truncate(x),0,"")" Hrs "totext(remainder(x,truncate(x))*60,0,"") + " Mins"Running Total (RTotal0)
    Field to Summarize - @TotalTime
    Type of Summary - sum
    Under Evaluate Section:
    "Use a Formula":
    onfirstrecord or
    {Data.ResourceStart} <> previous({Data.ResourceStart}) or
    {Data.Resource} <> previous({Data.Resource})
    ) and
    minimum({Data.ApptKind},{Data.ResourceStart}) = 1 AND
    maximum({Data.Column},{Data.ResourceStart}) >= '1'
    Reset on change of field {Data.Resource}
    A little background:My report deals with a Doctors schedule. In the doctors schedule, a appointment is booked and is by default placed into Column 1. It always defaults to Column 1. If the provider elects to double book their time and schedule another patient at the exact same time, the second appointment hits column 2. It expands in essence. It is possible to have up to 4 appointments in one time slot. This is why we wait forever at the Doctors office - appointments get overbooked because patients cancel or no show frequently and the provider would rather have the patients wait then risk no appointment at all. My Client wants the "TOTAL TIME" a provider was "scheduled" to see patients, not the time they actually saw the patients. So if the Provider was scheduled to see patients from 8 am to noon and had patients doublebooked for every time slot, I only want to report the overall time he saw patients regardless of the doublebooking, triplebooking or quadruplebooking. So the total time for my example should be 4 hours not 8 hours. The good news is this is painfully close to being correct! What is currently happening, is if the schedule contains more than 1 facility the time calculates wrong.  I think my issue may be in the running Total but not 100% sure. I need it to calculate time on each facility - {Data.Facility}.

    Post Author: Jeffs23
    CA Forum: Formula
    I had some minor issues with my formulas and Running Total so I modified them alittle:
    @TotalTime
    If {Data.ApptTime} = 0 then    0else    {Data.ApptTime}
    @Converted Time
    If {#RTotal0} = 0 then    "--"else    ToText(Truncate({#RTotal0}/60),0,"") + " Hour(s), " + ToText(Remainder({#RTotal0},60),0,"") + " Min(s)"
    My running total stayed the same.......
    Field to Summarize - @TotalTime Type of Summary - sum Under Evaluate Section: "Use a Formula":(onfirstrecord or{Data.ResourceStart} <> previous({Data.ResourceStart}) or{Data.Resource} <> previous({Data.Resource}) ) andminimum({Data.ApptKind},{Data.ResourceStart}) = 1 AND maximum({Data.Column},{Data.ResourceStart}) >= '1' Reset on change of field {Data.Resource}
    Some fake sample data:
    Resource = Francis, William MD
    Facility 1: River Oaks Main Clinic
    Facility 2: Western Medical Hospital
    Date of Service = 10/25/2007
    From 7:15 am to 11:45 am, Patients were treated at Facility 1: River Oaks Main Clinic *** (total time = 4 hours 30 min)
    From 12:15 pm to 1:00 pm, Patients were treated at Facility 2: Western Medical Hospital *** (total time = 45 min)
    From 1:00 pm to 3:15 pm, Patients were treated at Facility 1: River Oaks Main Clinic *** (total time = 2 Hours 15 min)
    The report should tell me Total time at River Oaks Main Clinic = 6 Hours 45 min and 45 min for Western Medical Hospital. What it currently is doing, is reporting the 6 Hours 45 min on the River Oaks Main Clinic and 7 Hours 30 min on the Western Medical Hospital. The time for this facility should be 45 minutes, yet its taking the full provider time and throwing it into this second facility. I am assuming its because the Running total tells it "Reset on change of field {Data.Resource}". Somehow, I need it to evaluate on both the Resource and the Facility. Any suggestions?

  • Getting running total formula result at the beginning of the report

    Hello All,
    I am having an inquiry that if I can get a grand total in the report footer to the report header.
    The grand total is not a direct sum.  I am using three formulas
    the first formula:
    @reset Group Header
    whileprintingrecords;
    numbervar sumpct4;
    if not inrepeatedgroupheader then
    sumpct4 := 0;
    the second formula: Details section
    whileprintingrecords;
    numbervar sumpct4 := sumpct4 + {@Total_Market};   // {@Total_Market}; =  Amount+ Interest
    numbervar grtotal4 := grtotal4 + {@Total_Market};
    Group Footer
    whileprintingrecords;
    numbervar sumpct4;
    Report Footer
    whileprintingrecords;
    numbervar grtotal4;
    All that I need is to show the total which is in the report footer at the top of the page where I am having a summary.
    So, can you please help me.
    Thanks
    Edited by: maas maas on Sep 8, 2010 12:48 PM

    Hello my friend,
    I want this to be controlled in crystal.
    Is there is a way to get the grand total by using multiple formulas or any other way?
    Here is the structure of my report:
    Group Header 1: CCY
    Group Header 2:Type
    @reset Group Header
    whileprintingrecords;
    numbervar sumpct4;
    if not inrepeatedgroupheader then
    sumpct4 := 0;
    Group Header 3A: Deal No
    Group Header 3B: Deal No (subreport to get the {@amount} for each deal)
    I will pass the end_date from the main report to subreport and I will get the sum(amount) for each deal between date (1-1-2008) to end_date. The sum will be as a shared variable to the {@amount} formual in the main report.
    Details:
    Deal No, {@amount}, {@Price}, {@market}, {@Total_Market}
    {@Price}: if {table.price} = 0 then
    100
    else {table.price}
    {@market}: if Type <> "DEP" then
    ({@amount}*{@Price})/100
    else
    {@amount}
    {@Total_Market}:{@market}+ {@Price}
    Running formula to get Total_market: Details section
    whileprintingrecords;
    numbervar sumpct4 := sumpct4 + {@Total_Market};
    numbervar grtotal4 := grtotal4 + {@Total_Market};
    Group Footer 3B: Deal No
    Group Footer 3A: Deal No
    Group Footer 2:Type
    In this group I am placing a running total formula:
    whileprintingrecords;
    numbervar sumpct4;
    Group Footer 1: CCY
    Report Footer:
    @grand_Total
    whileprintingrecords;
    numbervar grtotal4;
    Now, i want this @grand_total formula result to be shown in Group Header 1: CCY.
    I tried to insert a subreport at the beginning which it is a copy of the main report, but I did not get the coorec t result because I am getting the {@amount} from a subreport and in crystal I can't insert a subreport in an existing subreport.

  • Crystal report running total balance

    Hi guys, please help me.
    im creating a report using crystal report that display running balance from subreport.
    i do have subreport and add it to main report but i need it real time changing.
    for example
    TRANSACTION TYPE                    QTY_IN               QTY_OUT          RUNNING BALANCE
    RECEIVED                                        1                         0                         1
    RECEIVED                                        2                         0                         3
    SHIP OUT                                         0                          1                         2
    SHIP OUT                                         0                          1                         1
    RECEIVED                                        1                         0                          2
    diagram shows the needed output of the report. please help. thanks

    hi sir abhilash, i know you know how to fix this, maybe i need to provide some more information about the report: here what i did:
    created formula @QTY_IN where code is:
                                  if {ITRN.TRANTYPE} = 'DP' then
                                      {ITRN.QTY}
                                  else
                                  if{ITRN.TRANTYPE}='AJ' then
                                 (if {ITRN.QTY} >=0 then {ITRN.QTY}) else
                                  0
    create formula @QTY_OUT
                                  if{ITRN.TRANTYPE}='AJ' then
                                 (if {ITRN.QTY} >=0 then 0 else
                               {ITRN.QTY}) else
                                  if{ITRN.TRANTYPE}='WD' then
                            {ITRN.QTY}
                             else 0
    create running total fields for @QTY_IN And @QTY_OUT
                             total_qty_in and total_qty_out
                             sum the fields and resets every change of group.
    create a formula(running) based on your suggetion
    create running_total_reset code is
                                  WhilePrintingRecords;
                                  numbervar rt := 0;
    paste it to group header.
    the output is
                                      in               out             running
    shipment              0                -4               146116
    shipment             0                 -1               146117
    shipment               0               -4               146116
    but it should be
                                      in               out                            running
    shipment              0                -4    (-146118)           146114
    shipment             0                 -1    (-146114)           146113
    shipment               0               -4     (-146113)          146109
    so on so forth.
    we can do this sir. thanks ^__^.
    really appreciate your help.

  • Oracle report running total Resetting balance on next group

    Dear All,
    I am developing report on Oracle R12 fixed Assets, I have to calculate the running total for each asset.
    In brief
    Asset 1
    cost Deprciation Adjusted Cost
    50 - 2 48
    48 -5 45
    45 - 4 41
    I achieved that by using
    if :p_val is null then
    :result := nvl(:cost,0)-nvl(:depriciation,0);
    :P_val :='5';
    return :result;
    else
    :result := nvl(:result,0)-nvl(:depriciation,0) ;
    return :result;
    end if;
    working fine
    But problem is when the next asset start on same report
    Asset 2
    cost Deprciation Adjusted Cost
    100 5 36
    it substracts the last total (running total of previous asset with depriciation which was 41 in this example).
    Oracle Champs pl advice me how to solve this.
    I really dont got any idea how to solve this.
    thanks

    Dear,
    Thanks for your reply , in your reply what you said I tried this but in pl/sql I am not actually achieving the result. The balance is not resetting at next group if you give one accurate line it would be really helpfull.
    thanks

  • Report layout and running totals

    Hello everyone!
    I need to pick some brains. I need some help. I came across with a report where I have to add running totals for each state for years 2012, 2013, 2014 and to next column I have to calculate change in percentage annually. Basically, below the summary table sums the totals for the same years.
    Here how it look on excel
    I am trying to do the same thing on Crystal reports. Here how it looks:
    On the Crystal Reports I have to put that summary table for each state. on the beginning or on the end of the each state.
    Any help or suggestion is greatly appreciated.

    hi Korhan,
    you can do this by Inserting a Cross-tab on the Report Footer. have a look at the attachment...extract the contents and change the .txt extension to .rpt.
    right click on the cross-tab and choose Cross-tab Expert. note that there are two Sums on the same field.
    exit the cross-tab expert and right click on one of the summaries under YTY change and choose Format Field. under the Common tab look at the formula in the Display String dialogue. this is the formula that does all of the work. it uses the 2nd Sum value in the cross-tab expert and uses the Grid value functions that are available for the cross-tab. you can also go to the online help for crystal reports to learn more about these grid value functions.
    you can go back to the cross-tab exerpt then the Customize Style tab to see all of the various formatting options that were used on the cross-tab.
    cheers,
    jamie

  • Sub-Report Running Total

    Post Author: Set_Shot_Dave
    CA Forum: General
    Hello All,
    Let me set up my problem first.
    I have a running total from a subreport and a running total from my main report.
    I shared my running total from both reports ( it didn't work when I did or didn't).
    when I do my calculation I get a boolean true as my answer.
    By the way my running total from my main report is controled by a formula.
    In subreport I did the following;
    Called the formula share1
    shared numbervar Cong1;
    cong1 = sub-report-running total
    in main report i did the follwing
    called the formula share2
    shared numbervar Cong2;
    Cong2 = main-report-running total
    Still in main report
    I create a a field called Calcuation
    shared numbervar Cong1
    shared numbervar Cong2
    numbervar calculation
    calculation = Cong1 / Cong2
    I get a boolean True

    Post Author: Set_Shot_Dave
    CA Forum: General
    I brought in the shared variable into the report on its own.
    No calculation just a formula field as followed
    @calculation
    shared numbervar share1;
    numbervar calculation;
    calculation:= share1
    I get  0.00
    The fields are in the report footer of the main report and report footer of the sub-report is there a problem with this
    the

Maybe you are looking for