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

Similar Messages

  • 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

  • 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

  • Customer Statement Report - running total

    Greetings,
    Example : Customer XYZ has 3 invoices, and on the 06/02/08 cheque World Bank Acc 100200 $800 paid for
    Inv 2000
    02/01/08 Inv #1000 $1000
    05/02/08 Inv #2000 $800
    04/03/08 Inv #3000 $600
    The statement should show as below:
    Date        Details                      Dr             Cr          Balance
    02/01/08   Inv #1000                    1000                         1000
    05/02/08   Inv #2000                     800                         1800
    06/02/08   World Bank 100200                             800         1000
    04/03/08   Inv #3000                     600                         1600
    Anyone worked on some form of balance / running total like that before in the PLD ?
    Thank you
    Edited by: Davinder Singh on Jan 13, 2009 10:17 AM

    Please check this thread:
    Re: Running Total in QLD
    Thanks,
    Gordon

  • Crystal report running total explodes after adding a low-level characterist

    I've profit center hierarchy, suppressed to show only level 5 of the hierarchy in crystal report and the report has Group1:Division, Group2:Company Code and Group3:Profit Center hierarchy and I have summary at each group level.
    and now when I click on  a profit center, I want to drill-down to show all customers for that profit center, sales document and few other characteristics.... that I want to add to the details.
    After adding these characteristics to the details, the Summary at group division is not right for the AR Balance and I've other key figures and Iam sure they are also not correct. Any help with fixing this issue will be appreciated. Thanks.

    I've profit center hierarchy, suppressed to show only level 5 of the hierarchy in crystal report and the report has Group1:Division, Group2:Company Code and Group3:Profit Center hierarchy and I have summary at each group level.
    and now when I click on  a profit center, I want to drill-down to show all customers for that profit center, sales document and few other characteristics.... that I want to add to the details.
    After adding these characteristics to the details, the Summary at group division is not right for the AR Balance and I've other key figures and Iam sure they are also not correct. Any help with fixing this issue will be appreciated. Thanks.

  • Bring in a shared field from a sub report

    Post Author: Set_Shot_Dave
    CA Forum: General
    Hello All,
    Let me set what I'm doing first.
    I have a running total on my sub-report.
    Second I have a running total on my main report.
    I have to get a percentage of sub-report running total by main report running total.
    I shared the sub-report running total as followed:
    formula name @shared1
    shared numbervar share1;
    share1:= (sub-report running total)
    then I created a formula called Calculation just to see what I get.
    I did the following
    @calculation
    shared numbervar share1;
    numbervar calculation;
    calculation:= share1    this is where I get 0.00.
    But on my sub report  running total I get a 309. (which is correct)

    Post Author: PeterLiebich
    CA Forum: General
    In the formual in the main reqport u need to set the EvaluationTime To WhilePrintingRecords  - the reason that the formula is displaying zero is becuase it is evaluated once per report, (before the sub -report is executed) . This is because there are no databases fields etc.
    ie you formula should be (crsytal syntax)
    WhilePrintingRecords;
    shared numbervar share1;
    share1;
    (Basic Syntax)
    WhilePrintingRecords
    shared  share1 as number
    formula =  share1

  • Running total as alphabets

    I want to put a running total as alphabets.
    For Example
    1. Question Title
         A) Option 1
         B) Option 2
         C) Option 3
    2. Question Title
         A) Option 1
         B) Option 2
         C) Option 3
    I got the running numbers for Question Title but i am not getting the A,B,... for Answers.
    Have anyone done similar with Crystal Reports Running Total or any other different way?

    Hi Dharmesh,
    Try this:
    1) Group by Title
    2) Create this formula and place it on the Group Header:
    WhilePrintingRecords;
    numbervar i := 64;
    3) Create another formula and place this on the Details Section:
    WhilePrintingRecords;
    numbervar i;
    i := i + 1;
    if i <= 90 then
    chrw(i);
    -Abhilash

  • How do I put a running total in a Reports 6i Report?

    I need to write a report which shows a running total at the foot of each page. The report is a series of (potentially) multi-page sections each formatted like this:
    Page 1
    ======
    Tom £100
    Dick £150
    Harry £100
    Sub Total £350
    Page 2
    ======
    Peter £200
    Paul £50
    Mary £100
    Total £700
    Lines are of variable height, so I can't predict how many there'll be on a page.
    The help system just tells me to "use a summary field". Yeah, right. Can anybody give me some more detailed instructions?
    -- Chris Hunt

    Thanks for that.
    I didn't really express the problem as well as I might have done, as the Sub-Total needs to be the sum of all the items on the current page and on all preceeding pages. resetting on page just gives you the total for that page.
    I did find a way to do it. First you set up a summary field in the same group as the data lines, summing the amount and resetting on the parent group. This gives you a running total for each row:
    Page 1
    ======
    Tom £100 £100
    Dick £150 £250
    Harry £100 £350
    Page 2
    ======
    Peter £200 £550
    Paul £50 £600
    Mary £100 £700
    You don't actually output this summary field in the prinout (except when debugging :-) ). Now create a summary field at the foot of the page, or in the margin. Set its value to the Max() of the running total summary, resetting on page. That gives you the amount required, assuming all individual amounts are positive.
    If it's possible to have negative amounts, I expect that using Last() instead of Max() for the page summary would do the trick.

  • 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

  • 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.

  • Sub-report link doesn't work at run-time

    We have a main report and a sub-report linked to main-report. On clicking the sub-report link in the CR 2008 designer, sub-report page with data is rendered properly. Same doesn't work programmatically at run-time using Java SDK library (JRC). Any thoughts/suggestions?

    Hi,
    I am facing same problem. Please help.
    Thanks,
    Chanchal

  • 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

Maybe you are looking for