Running Total Problem

Hi All
I believe I have posted this question previously with no luck, but I have notice a few very clever new people so I will try again.(I have been working on this report for weeks and it is driving me nuts!!!)
I am using CRXI and have created a main report with a figures shown from two subreports. I have successfully created shared variables on both subreports (in details section a) and have created a running total to give me a total of figures (in details section b) from said subreports. I also have a group that I want the same calculation done as in the details section, eg;
Group1
details  subreport1        subreport2      runningtotal (subreport1+subreport2)
              $100.00            $150.00           $250.00
              $  50.00            $150.00           $200.00
                                                            $450.00  This is what I need to produce.
I thought that if I reproduce the running total formula and place in the group header and footer would have worked, but no. I have also declared new shared variables and used those in group header and footer, but all I get is the total of the last record in details.
I have a nasty feeling that I am missing something really stupidly obvious but can't see the trees for the forest.
Any help would be greatly appreciated.

I have a running total field in the details already, giving me a total for each record in the group. What I need now is a total for the group. I tried putting the formula for the group running total in the details like you suggested but it returned '0'. I have now put the formula for the group running total in GF1 and it is returning the sum of the last record out of each subreport. (I hope that makes sense!!) At least I have a figure there now, just not the right one.
Any help?

Similar Messages

  • Problem with "Running Total"

    Hi, I've created a calcution using the analytic function template "Running Total" and the worksheet ran fine. I saved the workbook with this new calculation.
    The next day when I attempt to run that worksheet I received the error "Database Error - ORA-00923 From keyword not found where expected."
    For some reason it's loosing the SUM( ) from the calc.
    Here's what the calc looks like now -> No of Queries OVER(PARTITION BY Calendar Year and Month ORDER BY Calendar Date ASC ROWS UNBOUNDED PRECEDING )
    This is what it looks like when I created it -> SUM(No of Queries) OVER (PARTITION BY Calendar Year and Month ORDER BY Calendar Date ASC ROWS UNBOUNDED PRECEDING)
    Brent.

    Well, I guess my thought process was declaring warrBaseYrPrc in the @currWarrBaseYrPrc formula which would make it a global variable and accessible to all formulas where that same variable is declared. I thought that if I declared warrBaseYrPrc in @currWarr2YrPrc, it would have its value as calculated in @currWarrBaseYrPrc and use that. And since @currWarr2YrPrc returns the variable warrBaseYrPrc with some slight modifications depending on the if statment, it shouldn't have refused use in the Running Total.
    So I'm kind of leaning more toward an ordering screw up (i.e. it didn't know what formula to evaluate first because they were all in the same section and dependent on one another because of nesting formula invocations, and thus treated @currWarr2YrPrc warrBaseYrPrc variable, and subsequent calculations, as a constant as you talked about and you can't RT constants). I still find it perplexing why it would treat a variable as a constant, but I guess I'll have to experiment with it a little bit.
    By the way, do you know of any good free crystal report debugging tools?

  • Problems with running totals

    I'm having some trouble getting the correct number when a drive has multiple incentives associated with the drive.  And to explain as fully as I can, every drive has a projecture procedure count and when complete, a performed procedure count associated with the drive.  And when a drive has an incentive assigned to it, I would like to count the drive's projected and performed procedure count to the incentive count.  In the screen shot, there are five drives with four each having one incentive to the drive. The incentive count in which only one incentive is assigned to one drive is correct, but the Fandango pre-drive and post-drive counts are off because it is not counting the 12 and 15 that were collected on the bottom drive.
    For my running total, I am summing the ProceduresPerformed field, evaluating on the change of field of DriveID (each drive) and reseting on the change of field for EquipmentID (each incentive has its own unique ID).
    What would be the best way to handle drives with multiple incentives to get the correct count?

    Hello DJ,
    Let me see if I can explain more clearly to help you understand.
    I think the most important thing is that each drive is unique and will have one projected procedure number and one performed procedure number.  But each drive may have multiple incentives assigned to each drive. Where I run into trouble is when I have more than one incentive on a drive.
    I'll try to illustrate below:
    Drive
    Projected
    Performed
    Incentive(s):
    A
    10
    12
    Movie Tickets
    Gift Card
    B
    5
    10
    Movie Tickets
    Beach Towel
    C
    20
    25
    Gift Card
    Based on these entries, what I'm trying to have summarized should look like this:
    Pre-Drive (Sum of Projected)
    Post-Drive (Sum of Performed)
    Movie Tickets
    15
    22
    Gift Card
    30
    37
    Beach Towel
    5
    10
    So if an incentive is assigned to a drive, I would like to have all of the projected and performed numbers summarized that the particular incentive appears on.  Hopefully this makes sense.
    And one last screen shot here of a query I ran against the database to illustrate how a drive can have multiple incentives on the drive.

  • Running Total - How to summarize a formula field?

    I'm sorry if this comes over as stupid but I have got myself quite messed up and am not 100% au fait with Crystal Reporting.
    The aim of my report is to calculate the costs of selected tests and to calculate a grand total of all tests at the end.
    I have created a group of  jobtests.TestTypeName
    Details
    1. testTypeName - to show Test Name that is being calcutaed - Database field
    2. Count ({jobTests.testTypeName}, {jobTests.testTypeName}) - to show number of tests of that type - this is a formula field
    3. Analysis1 - to show the cost of that test type - Database field
    4. {@CountTests/TestType} * {jobTests.AnalysisN1} - to show the number of tests per test type mulitplied by the cost of that test type - this is a formula field
    Report footer
    Count ({jobTests.testTypeName}) - to count the total number of tests
    MY PROBLEM - I need to see the sum of 4, this would be my grand total
    Trying to run the Running Total I can't get it to Summarize the field 4 because it is a formula field.
    What can I do?
    Thanks.

    You can't do a SUM on a formula that uses another aggregate function.  However, for both 4 and your grand total, you just need to SUM() (with ",{jobTests.testTypeName}" for the #4 calc), as the database field will be the cost for each test in each record.
    HTH,
    Carl

  • Error when using running total variable in formula

    This is probably an easy syntax problem, but I'm fairly new to Crystal reporting.  I created a running total variable (count) called InquiryTypeSubtotal that simply counts the number of records.  I have one grouping level, and in the group footer I'd like to print a line showing the total count for that group that looks like
    Total inquiries for Assistive Technology: 3
    To accomplish this I'm using a formula field with the following syntax:
    "Total inquiries for " + {CnAttrCat_1.CnAttrCat_1_Description} + ": " + ToText(@InquiryTypeSubtotal)
    When I try to check the formula, I get the error message "The ) is missing."  What am I doing wrong?
    Thanks,
    Alec

    I put in the curly brackets so my formula now reads
    "Total inquiries for " + {CnAttrCat_1.CnAttrCat_1_Description} + ": " + ToText({@InquiryTypeSubtotal})
    Now when I check the formula I get the error message "This field name is not known."
    Alec

  • 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

  • Running total of calculated field in pivot

    VERSION: ORACLE 11
    TABLE:
    create table chart_detail (
    DIS        NUMBER,
    BLD_MO VARCHAR2(7),
    BLD        NUMBER(10),
    RPLC      NUMBER(10));DATA:
    insert into chart_detail values (60,'2011-03',0,2);
    insert into chart_detail values (150,'2011-04',10572,0);
    insert into chart_detail values (120,'2011-04',26449,5);
    insert into chart_detail values (30,'2011-04',0,1);
    insert into chart_detail values (60,'2011-04',0,7);
    insert into chart_detail values (90,'2011-04',0,9);
    insert into chart_detail values (120,'2011-05',5714,0);
    insert into chart_detail values (90,'2011-05',24557,1);
    insert into chart_detail values (60,'2011-05',0,4);
    insert into chart_detail values (30,'2011-05',0,0);
    COMMIT;EXPECTED RESULTS:
         2011-04                    2011-05               
    DIS     RPLC     BLD     TBLD     IPTV     RPLC     BLD     TBLD     IPTV
    30     1     0     37021     0.03     0     0     30271     0.00
    60     7     0     37021     0.22     4     0     30271     0.13
    90     9     0     37021     0.46     1     24557     30271     0.17
    120     5     26449     37021     0.59     0     5714     5714     0.17
    150     0     10572     10572     0.59               0     
    180               0                    0     
    TOTAL     22     37021               5     30271          PROBLEM: I need to have a running total of IPTV like in the above example. I can get the IPTV for each DIS/bld_mo but I don't know how to get the running total of it. In the script below I just used an example where I tried summing the IPTV like was done for build. I know it can't be done that way because IPTV is a calculated field in the query but if I substitute "APR_IPTV" with the formula for IPTV I get an error that window functions aren't allowed here. I do not know a way around this. I commented out the bad piece of code.
    PROBLEM SCRIPT:
    WITH  pivot_results  AS
      SELECT    dis
      ,    NVL (apr11_rep,  0)  AS apr11_rep
      ,    NVL (apr11_bld,   0)  AS apr11_bld
      ,    NVL ( SUM (apr11_bld)
                      OVER (ORDER BY dis DESC)
                    ,                 0
                    )        AS apr11_tbld
    ,      DECODE(NVL ( SUM (apr11_bld)
                      OVER (ORDER BY dis DESC)
                    ,                 0),0,0,ROUND(NVL(apr11_rep, 0)*1000/ NVL ( SUM (apr11_bld)
                      OVER (ORDER BY dis DESC)
                    ,                 0),2
                    ))        AS apr11_iptv               
    ,      NVL ( SUM (apr11_iptv)
                      OVER (ORDER BY dis DESC)
                    ,                 0
                    )        AS apr11_tiptv  
      ,    NVL (may11_rep,  0)  AS may11_rep
      ,    NVL (may11_bld,   0)  AS may11_bld
      ,    NVL ( SUM (may11_bld)
                      OVER (ORDER BY dis DESC)
                    ,                 0
                    )        AS may11_tbld
    ,      DECODE(NVL ( SUM (may11_bld)
                      OVER (ORDER BY dis DESC)
                    ,                 0),0,0,ROUND(NVL(may11_rep, 0)*1000/ NVL ( SUM (may11_bld)
                      OVER (ORDER BY dis DESC)
                    ,                 0),2
                    ))        AS may11_iptv
    ,      DECODE(NVL ( SUM (may11_bld)
                      OVER (ORDER BY dis DESC)
                    ,                 0),0,0,ROUND(NVL(may11_rep, 0)*1000/ NVL ( SUM (may11_bld)
                      OVER (ORDER BY dis DESC)
                    ,                 0),2
                    ))        AS may11_tiptv               
      FROM     chart_detail
      PIVOT     (  MAX (rplc)  AS rep
              ,  MAX (bld)  AS bld
              FOR  bld_mo   IN ( '2011-04'  AS apr11
                                             , '2011-05'  AS may11
    SELECT    CASE
            WHEN  GROUPING (dis) = 0
            THEN  TO_CHAR (dis)
            ELSE  'Total'
        END      AS dis
    ,    SUM (apr11_rep)  AS apr11_rep
    ,    SUM (apr11_bld)  AS apr11_bld
    ,    SUM (apr11_tbld) AS apr11_tbld
    ,    CASE
            WHEN  GROUPING (dis) = 0
            THEN  SUM (apr11_iptv)
        END      AS apr11_iptv
    ,    SUM (apr11_tiptv) AS apr11_tiptv
    ,    CASE
            WHEN  GROUPING (dis) = 0
            THEN  SUM (apr11_tpiptv)
        END      AS apr11_tiptv
    ,    SUM (may11_rep)  AS may11_rep
    ,    SUM (may11_bld)  AS may11_bld
    ,    SUM (may11_tbld) AS may11_tbld
    ,    CASE
            WHEN  GROUPING (dis) = 0
            THEN  SUM (may11_iptv)
        END      AS may11_iptv   
    FROM    pivot_results
    GROUP BY  ROLLUP (dis)
    ORDER BY  pivot_results.dis
    ;Thank you,

    Hi,
    So you know how to compute iptv for an individual row; the problem now is that you want to get a running total of iptv; is that it?
    The problem there is that computing iptv requires an analytic function, and analytic functions can't be nested. To get the results of nesting f (g (x)), where f and g are analytic funtions, you have to compute g in a sub-query, and then use the results as the argument to f in a super-query.
    Here's how to apply that to your situation:
    WITH  pivot_results  AS
         SELECT    dis
    -- April, 2011
           ,           NVL (apr11_rep,   0)  AS apr11_rep
           ,           NVL (apr11_bld,   0)  AS apr11_bld
           ,           NVL ( SUM (apr11_bld)
                                       OVER (ORDER BY dis DESC)
                          , 0
                          )               AS apr11_tbld
         ,      NVL ( 1000 * apr11_rep
                              / NULLIF ( SUM (apr11_bld) OVER (ORDER BY dis DESC)
                                          , 0
                   , 0
                   )               AS apr11_iptv
    -- May, 2011
           ,           NVL (may11_rep,   0)  AS may11_rep
           ,           NVL (may11_bld,   0)  AS may11_bld
           ,           NVL ( SUM (may11_bld)
                                       OVER (ORDER BY dis DESC)
                          , 0
                          )               AS may11_tbld
         ,      NVL ( 1000 * may11_rep
                              / NULLIF ( SUM (may11_bld) OVER (ORDER BY dis DESC)
                                          , 0
                   , 0
                   )               AS may11_iptv
           FROM     chart_detail
           PIVOT    (    MAX (rplc)  AS rep
                    ,    MAX (bld)   AS bld
                    FOR  bld_mo   IN ( '2011-04'  AS apr11
                                      , '2011-05'  AS may11
    SELECT    CASE
                  WHEN  GROUPING (dis) = 0
                  THEN  TO_CHAR (dis)
                  ELSE  'Total'
               END      AS dis
    -- April 2011
    ,           SUM (apr11_rep)  AS apr11_rep
    ,           SUM (apr11_bld)  AS apr11_bld
    ,           SUM (apr11_tbld) AS apr11_tbld
    ,           CASE
                  WHEN  GROUPING (dis) = 0
                  THEN  ROUND ( SUM (SUM (apr11_iptv))
                                          OVER (ORDER BY  dis)
                      , 2
               END      AS apr11_iptv
    -- May 2011
    ,           SUM (may11_rep)  AS may11_rep
    ,           SUM (may11_bld)  AS may11_bld
    ,           SUM (may11_tbld) AS may11_tbld
    ,           CASE
                  WHEN  GROUPING (dis) = 0
                  THEN  ROUND ( SUM (SUM (may11_iptv))
                                          OVER (ORDER BY  dis)
                      , 2
               END      AS may11_iptv
    FROM      pivot_results
    GROUP BY  ROLLUP (dis)
    ORDER BY  pivot_results.dis
    ;Output:
          APR11  APR11   APR11  APR11 MAY11  MAY11   MAY11  MAY11
    DIS    _REP   _BLD   _TBLD  _IPTV  _REP   _BLD   _TBLD  _IPTV
    30        1      0   37021    .03     0      0   30271    .00
    60        7      0   37021    .22     4      0   30271    .13
    90        9      0   37021    .46     1  24557   30271    .17
    120       5  26449   37021    .59     0   5714    5714    .17
    150       0  10572   10572    .59     0      0       0    .17
    Total    22  37021  158656            5  30271   96527As you can see, this is not quite what you wanted on the row where dis='150'. You asked for NULLS in the may11_rep, may11_bld and may11_iptv columns. You can get those results if you need them; just explain the rules that govern whether to display the values and when to display NULL.
    The way you posted the sample data and results, and the quantity of sample data were all excellent; it really helped me find a solution. Thanks.
    It would have also helped it you had explained how iptv is computed. Basically, iptv = 1000 * rep / tbld, right?
    It looks like most of this code:
    ,      DECODE(NVL ( SUM (may11_bld)
                      OVER (ORDER BY dis DESC)
                    ,                 0),0,0,ROUND(NVL(may11_rep, 0)*1000/ NVL ( SUM (may11_bld)
                      OVER (ORDER BY dis DESC)
                    ,                 0),2
                    ))        AS may11_iptvwas a way of avoiding divide by 0 errors; it would have been helpful if you had explained that.

  • Graphing a RUNNING TOTAL on a line graph

    So I'm having a lot of trouble putting my data on a chart. I have it all laid out here: files.me.com/redsteven1/glwk4v.numbers.zip
    Whenever I try to graph it though I run into a whole host of problems. Namely, that I can't get the values to plot on the chart at all.
    Not sure what the problem is... I select A2:G103... and I see the different series (for each Activity) show up in the legend, but nothing is plotted on the chart.
    I know that much of the table is blank... that's because I'll be adding to it every day.
    Ideally, the X-axis should be time/date.... May, June, July, and August can be the major tick marks. And the Y-axis would be number of hours spent on each activity.
    To further complicate things, the chart should really be a running total of time spent on each activity... so if I spend an hour on Activity 1 each day for 3 days... then on the third day I should have a plot of 3 hours... not 1.
    I know I didn't work things super well here... hopefully you can figure out what I mean by looking at the linked file : \
    Thanks in advance.

    I guess that line graph isn't the best one, I would use the Scatter one.
    You can't chart your datas as they are at this time.
    Every datas are date_time or duration values which can't be charted as is.
    Here, I converted the dates from column A into strings
    Then I added 6 columns in which I converted the durations into decimal hours.
    The original columns are hidden.
    The formula used to convert is a simple one.
    In H2, I inserted :     
    =STRIPDURATION(B)*24
    Fill to the right
    Fill Down
    to fill the other cells.
    Yvan KOENIG (VALLAURIS, France) dimanche 22 mai 2011 21:26:18
    Please :
    Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • 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 Variation Query Time Optimization

    Hi all, 
    I've been struggling with this query for a while. I need to set a customer specific running total for 10 million rows (reset for every customer). But every time the number goes negative, I need to set it as zero.
    For example,
    member no              amount            wallet
    member1                 400                      400
    member1                 -500                     0
    member1                  200                    200
    member2                  700                    700
    member2                 -200                    500
    Query:
    DECLARE @member float
    DECLARE @prev_member float
    DECLARE @amount float
    DECLARE @wallet float
    DECLARE db_cursor CURSOR FOR  
    SELECT [Member no], [Transaction Amount] 
    FROM [wallet_master_3]
    ORDER BY [Member No], [rownum]
    FOR UPDATE
    OPEN db_cursor
    FETCH NEXT FROM db_cursor INTO @member, @amount
    SET @prev_member = @member
    set @wallet=0
    WHILE @@FETCH_STATUS = 0
    BEGIN   
           IF @prev_member <> @member set @wallet=0
           SET @wallet = @wallet + @amount
           IF @wallet < 0 SET @wallet = 0
           UPDATE [wallet_master_3] SET walletsize = @wallet
           WHERE CURRENT OF db_cursor
           set @prev_member=@member
           FETCH NEXT FROM db_cursor INTO @member, @amount
    END   
    CLOSE db_cursor   
    DEALLOCATE db_cursor
    I've tried using a cursor. In five minutes, it ran 17,000 rows but after running it for 15 hours, the code only manages to set the running total for 175,000 rows. I'm not exactly sure why. Is there a faster approach I can use? 
    Thanks!

    As an exercise a 'Quirky Update' may help you in this scenario. Try the below trick!
    DECLARE @Wallet AS TABLE
    MemberNo VARCHAR(10),
    RowNum INT,
    Amount INT,
    Wallet INT
    INSERT INTO @Wallet (MemberNo, RowNum, Amount) VALUES
    ('member1',1, 400),
    ('member1',2, -500),
    ('member1',3, 200),
    ('member2',1, 700),
    ('member2',2, -200)
    DECLARE @RunTotal AS INT
    UPDATE W1
    SET
    @RunTotal = W1.Wallet =
    CASE
    WHEN W1.RowNum = 1 THEN W1.Amount
    WHEN @RunTotal + COALESCE(W1.Amount, W2.Amount) < 0 THEN 0
    ELSE @RunTotal + COALESCE(W1.Amount, W2.Amount)
    END
    FROM @Wallet W1
    LEFT OUTER JOIN @Wallet W2
    ON W1.MemberNo = W2.MemberNo AND W2.RowNum = W1.RowNum - 1;
    SELECT * FROM @Wallet;
    RESULT
    MemberNo RowNum Amount Wallet
    member1 1 400 400
    member1 2 -500 0
    member1 3 200 200
    member2 1 700 700
    member2 2 -200 500
    You can read more on 'Quirky Update' in below articles
    Solving the Running Total and Ordinal Rank Problems - Jeff Moden
    Robyn Page's SQL Server Cursor Workbench
    NOTE: Please test it thoroughly before using in a production environment!
    Krishnakumar S

  • Require a formula to calc the diff between 2 running total fields in a crosstab

    Post Author: PJM
    CA Forum: General
    Hi,
    I have built a crosstab in Crystal XI with the following columns:
    PROFILED BUDGET (a)                            EXPENDITURE TO DATE (b)                        VARIANCE (a-b)
    The profiled budget and expenditure to date columns are both running total fields.  I want the variance column to show the difference between the budget and expenditure. 
    To set the variance field up as a running total, I assume that I would have to specify that I want this formula evaluated after the budget and expenditure fields , however, I can't work out how to do this on a crosstab. 
    Moving the crosstab to the report footer has had no impact.
    If I try to create a basic formula using the running totals, I get the error message "A summary has been specified on a  non-recurring field" - I can't find an explanation of this error message on the help menu.
    Can anyone help with this please?

    overtime hours are calculated after 40. If I work 12 on monday, thats 12 regulars hours. not sure about others states laws but here in wisconsin we consider overtime after 40 only, not after 8 daily. at least thats how my company calculates overtime. lets say I work 10 hours a day, monday thru thursday, thats 40 hours regular time. anything after that is overtime. our weekly work schedule starts on sunday and ends on saturday. so on my bi-weekly time log, if i work 10 hrs a day monday thru thursday, i want 10hrs each day in regular hours cell, then when i work friday and or saturday, i want those hours in overtime hours. the main problem im having is: if i reach 40 hours in the middle of a day, i want the regular of that day to end and the overtime to pick up on the same day.
    here is a basic example of how i want regular and overtime to look. of course the values will be duration not just numbers. hope this helps explain what i need a bit better.

  • Running Total in forms 4.5

    Hi,
    I have a forms 4.5 with a master and detail block.
    The detail block displays 15 record at a time. There is a column in the detail field whose total is to be displayed at the bottom.
    I am using post-query to sum this item and display it at the bottom.
    The solution works fine fine if the detail block has 15 or less records and the running total is displayed correctly.
    But If I query a master records where there are 20 detail records then the total sum at the bottom only show sum of the 15 detail records that are displayed and not 20.
    For that I have to navigate to record 15, key next , 16 and so on then the post-query trigger fires and add the rest of the records and displays the correct total.
    I have tried to change the record buffered/fetched in the detail block query but it does not help.
    Can anyone suggest a solution for this problem in forms 4.5?
    Thanks
    Jakh

    Try Last_record instead of next_record.
    Any other suggestion is that.
    You must have a primary key and foreign key in your master detail form. Then why dont you write a select statement on POST-QUERY:
    You have a master block (master) having columns invoice_id, date, cust_id and have a detailed block (detail) having columns invoice_id (using as foreign key from master table block) and item_id, item_description, quantity, amount
    Write query on POST-QUERY on detail block as
    select sum(amount) into :control_block.total from detail where detail.invoice_id = :master.invoice_id
    or select sum(amount) into :control_block.total from detail where detail.invoice_id = :detail1.invoice_id;
    it should give you the required result. I have used it and its working fine for me.
    Thanks.
    Hassan

  • 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

  • Running total of another running total ( or some other solution )

    I posted in my previous thread that I would like to be able to do rounding at the subtotal level and then have a total of these subtotals.  Here is the original thread:
    totals in a cross tab report
    So I was told that with the cross-tab report I can either do rounding at the details level or at the final total level.  However, I need to be able to do the following:
    Suppose I receive payments from different states.  In my report I would like to be able to display:
    - a total of all payments for one given state, rounded to whole dollars - this one is easy because I just create a running total for the payments and then at the end I round it to whole dollars
    - a total of all payments and all states as one number.  However, the problem I can't figure out here is that this grand total needs to be calculated as the SUM of the totals for each state where the total for each state is rounded to a whole dollar before being added to the grand total.  So the rounding should not be done on the final grand total but rather:
    1. calculate the total of payments for one state and round it to a whole dollar - let's call it StateTotal ( rounded)
    2. calculate the SUM of all StateTotal values.  So it needs to be a SUM of the already rounded state totals.
    Any help will be greatly appreciated.
    thanks

    hello all,
    if you want to use a manual running total then that is okay. you don't actually put the manual running total in the cross-tab expert though as you will get a print time error.
    you use the "Display String" formula dialogue on an existing cross-tab summary to do the manual running total in.
    have a look at the attached sample...there are 2 manual running totals in there...one that goes horizontally (across the columns) and one that goes vertically (down the rows).
    there is also a Xtab Info column that is there just to show you how the manual running total counter variables are incremented through the cross-tab. in crystal reports 2008 there are a lot of new cross-tab functions that are different from this but that is a completely different topic.
    i hope this helps,
    jamie

  • Running totals in crystal designer

    Hi all!
    I want to create a report with running total, that accumulate Balance value for each page.
    Total accumulate should be reseted on each new page.
    I have a query for report: SELECT CardCode, CardName, Balance FROM OCRD.
    And i want a running total for field "Balance" (this total should be reseted on each new page).
    In Crystal Designer I create new Running Total Field (in the PageFooter section).
    In the Editing Running Total window I fill the following sections:
    1) Summary section. Field to summarize: "Command.balance". Type of summary: "sum".
    2) Evaluate section. On change of field: "command.cardcode"
    3) Reset section. I want to choose PageNumber in the field "on change of field". But there is no any special field in the section "Available tables and fields"
    How to reset the running total on each new page?
    Thanks in advance

    Hi all!
    The problem can be solved with report formulas. Probably this information will be useful to somebody.
    So, we have the following task: need to calculate subtotals on each page.
    Let's look at the solution.
    On the first step, create Formula fields:
    1) InitPageSum field has formula:
         WhilePrintingRecords; NumberVar PageSum := 0;
    2) CalcPageSum field has formula:
         WhilePrintingRecords;
         numberVar PageSum := PageSum + {Command.LineTotal}; // I use command to get field-values from //database
         numberVar PageSum
    3) PageBalance field has the following formula:
         WhilePrintingRecords; numberVar PageSum
    On the second step we place formula-fields in report sections.
    1) Variables initialization.
    Insert section in PageHeader area (lets name this section PHa). Drag formula InitPageSum into PHa for zeroing PageSum for each page. Then suppress the section PHa.
    2) Increasing subtotal on page.
    Create additional section in Details area (Dc). Drag CalcPageSum formula-field on this section (Dc). PageSum variable will be increasing in each line. Suppress the section Dc.
    3) Display results.
    a) Insert additional section in PageFooter area (let's name it PFa). Drag PageBalance formula-field into this section (PFa). The section PFa should be displayed on each page of the report, except the last page. The formula is:
    if PageNumber  <>  TotalPageCount then true else false.
    b) Insert additional section in ReportFooter area (let's name it RFa) and make this section the first section of the Report Footer area. Drag PageBalance formula-field into the section RFa. The section RFa should be displayed on the last page only. So, for the Suppress property of this section, create the formula:
    if PageNumber  =  TotalPageCount then true else false
    We make this adjustment (additional section in report footer area) because we need subtotals directly under the report (and not at the bottom of the page)
    Best regards,
    Katrine

Maybe you are looking for

  • ⌘T does not open new tab in Finder

    In Finder under the File menu, the "New Tab" command has ⌘T as a keyboard shortcut. However, when I use those combination of keys, a new tab does not open. I am currently running Yosemite, but this was also the case when I was running Mavericks. Is t

  • [SOLVED] System froze and won't boot.

    When I pluged in my power adapter on my laptop my entire system froze and forced me to cut the power. Now when I try to boot it I get several errors about mounting and udev and more which I can't catch in the speed. Then it enters a long loop of prin

  • Runtime error while posting goods in MB1C

    Hi,gurus When in MB1C i am trying to post goods.While saving i got message 49 number ranges should be defined.I done it clear in FBN1.So when i am saving posting goods i am getting runtime dump error.So how can i solve this problem Regards, Suresh

  • Change quality of JPEG byte array

    I have a JPEG file which I read into a byte array in my program, the problem is that I need to change the quality of this image, is it possible? If so, how?

  • Screen share problem

    me and my mate keep trying to share his screen. he can share my screen fine, but the option to share his screen is greyed out. it is the same on both computers. does anyone know whats wrong? we are both running snow leopard and have the latest ichat.