Running total for item availbe qty. from On Hand - SO + PO by promise date

I stuck with Balance(running total).
How to link item number with SO and PO?  
Need daily item qty. available qty from "On Hand" Qty. + PO - SO by promise date and sort by ascending?
Item#    Order Date  SO/PO   PromiseDate  Qty   Bal.
AE01    08/01/08     OnHand                       20     20
            08/02/08     SO#1877   08/05/08       -3    17
            08/04/08     SO#2044   08/08/08       -6    11
            07/22/08     PO#632     08/10/08      10   21
Thanks.

create a group by promise date
2nd group by po#
put the fields either in the group or in the details
PO#, PO promise date, qty and SO#, SO promise date, qty then availability qty
manual running totals
create 3 formulas
1 reset
WHILEPRINTINGRECORDS;
NUMBERVAR ITEMLOC := 0;
place in the group header on what you want the total to reset by (po#)
1 calc
WHILEPRINTINGRECORDS;
NUMBERVAR ITEMLOC := ITEMLOC +(qty};
this gets placed where the calculate will take place (next to qty)
1 display
WHILEPRINTINGRECORDS;
NUMBERVAR ITEMLOC;
ITEMLOC
this gets placed in the group footer.
for each field that gets calculated by a group create 3 formulas for each
they need to have the same variable name to reference each other.
if you need to create a 2nd set to calc something else give that a new variable name.

Similar Messages

  • Running total for duplicate rows

    Hi,
    I am trying to write an sql which shows the running total for records which has duplicate. Please share any idea to get this.
    sample rows:
    col1 col2 col3
    1      A    2
    1      A    2
    1      A    2
    1      B    3
    1      B    3
    1      C    5
    1      D    2
    1      D    2o/p required:
    col1 col2 col3  cumulative_tot
    1      A    2       2
    1      A    2       2
    1      A    2       2
    1      B    3       5
    1      B    3       5
    1      C    5       10
    1      D    2       12
    1      D    2       12

    Hi,
    Try this:
    WITH A AS
    select 1 col1,  'A' col2, 2 col3  from dual union all
    select 1 col1,  'A' col2, 2 col3  from dual union all
    select 1 col1,  'A' col2, 2 col3  from dual union all
    select 1 col1,  'B' col2, 3 col3  from dual union all
    select 1 col1,  'B' col2, 3 col3  from dual union all
    select 1 col1,  'C' col2, 5 col3  from dual union all
    select 1 col1,  'D' col2, 2 col3  from dual union all
    select 1 col1,  'D' col2, 2 col3  from dual
    ,B AS
    SELECT
      A.*
      ,ROW_NUMBER() OVER (PARTITION BY COL1, COL2 ORDER BY 1) RN
    FROM
      A
    SELECT
      B.*
      ,SUM(CASE WHEN RN = 1 THEN COL3 ELSE 0 END) OVER ( ORDER BY COL1, COL2 ,RN ) cumulative_tot
    FROM
      B
    COL1 COL2 COL3 RN CUMULATIVE_TOT
       1 A       2  1              2
       1 A       2  2              2
       1 A       2  3              2
       1 B       3  1              5
       1 B       3  2              5
       1 C       5  1             10
       1 D       2  1             12
       1 D       2  2             12
    8 rows selected Regards,
    Peter

  • CALCULATE RUNNING TOTALS FOR SUBSETS OF THE DATA IN A SECTION

    How can I calculate a running total in BO XI Release 2, (WebI), where my totals only include the value of the current row and the previous 5 rows?
    For Example:
            In the data, behind my BO table, I have transaction dates that roll up to a dimension called Period.  The "Period" represents the Year and Month of the transaction date, which is a month's worth of data at a time.  Each month contains an aggregated value that is the Population of items for that month.  The RunningSum function in BO works well, except that I need the running total to only include the current month along with the last 5 months, for a total of 6 months worth of data per row. 
            See my example below.  The Period of JAN 2009 includes the Population for JAN 2009 plus the sum of the Populations from AUG 2008 through DEC 2008 for a total of 6 months worth of data.  FEB 2009 includes SEP 2008 through FEB 2009.  MAR 2009 includes OCT 2008 through MAR 2009...
    __________Period_______Population_______6 MOS
    __________200801__________54___________54
    __________200802__________60__________114
    __________200803__________50__________164
    __________200804__________61__________225
    __________200805__________65__________290
    __________200806__________58__________348
    __________200807__________70__________364
    __________200808__________64__________368
    __________200809__________59__________377
    __________200810__________62__________378
    __________200811__________66__________379
    __________200812__________75__________396
    __________200901__________62__________388
    __________200902__________53__________377
    __________200903__________63__________381
    __________200904__________67__________386
    Six months is obviously no magic number.  I'd like the solution to be flexible enough to use for 3, 12, 18, or 24 month periods as well.

    Hi Frank,
    can you consider building the rolling sums directly in your database using subselects in the select statement:
    eg. select attr1, attr2,key2, (select sum(key1) from B where B.month<=A.month and B.month>=A.month-6) from A
    Just create a key figure in your universe and add the subselect statement select sum(key1) from B where B.month<=A.month and B.month>=A.month-6 as select-clause.
    ATTENTION: This is SQL pseudo code.
    Regards,
    Stratos

  • Running Total for "cleared balance"

    I want to produce query that will produce two running totals. The 1st once is straight forward and is 'Ledger Balance' - that is the balance after a particular transaction has taken place on that day. The Cleared Balance is the running total balance accounting for the value date of a transaction. For example a transaction for today, say $50 may be value dated tomorrow and hence is included in the Ledger Balance but would not appear in the Cleared balance until tomorrow.
    Lets try and use some simple data:
    TransactionsTable                    
    Tran_ID     TranDate     ValueDate     Amount
    1     01/02/2004     01/02/2004     50
    2     01/02/2004     01/02/2004     25
    3     01/02/2004     05/02/2004     30
    4     01/02/2004     01/02/2004     55
    5     02/02/2004     04/02/2004     11
    6     02/02/2004     02/02/2004     23
    7     02/02/2004     02/02/2004     33
    8     02/02/2004     02/02/2004     47
    9     04/02/2004     04/02/2004     10
    10     07/02/2004     07/02/2004     5
    StatementHistory                    
    AC_No     Start_Date     End_Date     Opening_Ledger     Opening_Cleared
    55     02/02/2004     02/02/2004     160          130
    55     04/03/2004     04/02/2004     274          233
    Assuming that the account opened on the 01/02/04 with a zero balance.
    So for a daily statement on the 01/02/04, I'd expect to see the following Details     
    TranDate     ValueDate     Amount     Ledger Balance     Cleared Balance
    01/02/2004     01/02/2004     50     50          50
    01/02/2004     01/02/2004     25     75          75
    01/02/2004     05/02/2004     30     105          75
    01/02/2004     01/02/2004     55     160          130
    So for a daily statement on the 02/02/04, I'd expect to see the following Details
    TranDate     ValueDate     Amount     Ledger Balance     Cleared Balance
    02/02/2004     04/02/2004     11     171          130
    02/02/2004     02/02/2004     23     194          153
    02/02/2004     02/02/2004     33     227          186
    02/02/2004     02/02/2004     47     274          233
    And skipping to the 04/02/04, I'd expect to see.
    04/02/2004     04/02/2004     10     284          254
    I can get the ledger balance using:
              sum(amount_to_account) OVER (PARTITION BY ac_no , trans_ID
              ORDER BY TranDate, trans_ID
              RANGE UNBOUNDED PRECEDING)
         + sh.Opening_Ledger
    But I'm unsure how to get the Cleared balance as this need to access transaction inforation from a number of days previous (possibly up to 5 days allowing for maximum period for clearing a transaction).
    Does anyone have an idea how to achive this?

    Hi,
    Try this:
    WITH A AS
    select 1 col1,  'A' col2, 2 col3  from dual union all
    select 1 col1,  'A' col2, 2 col3  from dual union all
    select 1 col1,  'A' col2, 2 col3  from dual union all
    select 1 col1,  'B' col2, 3 col3  from dual union all
    select 1 col1,  'B' col2, 3 col3  from dual union all
    select 1 col1,  'C' col2, 5 col3  from dual union all
    select 1 col1,  'D' col2, 2 col3  from dual union all
    select 1 col1,  'D' col2, 2 col3  from dual
    ,B AS
    SELECT
      A.*
      ,ROW_NUMBER() OVER (PARTITION BY COL1, COL2 ORDER BY 1) RN
    FROM
      A
    SELECT
      B.*
      ,SUM(CASE WHEN RN = 1 THEN COL3 ELSE 0 END) OVER ( ORDER BY COL1, COL2 ,RN ) cumulative_tot
    FROM
      B
    COL1 COL2 COL3 RN CUMULATIVE_TOT
       1 A       2  1              2
       1 A       2  2              2
       1 A       2  3              2
       1 B       3  1              5
       1 B       3  2              5
       1 C       5  1             10
       1 D       2  1             12
       1 D       2  2             12
    8 rows selected Regards,
    Peter

  • Keeping a Running Total for Formula fields

    Post Author: khanh
    CA Forum: Formula
    I've been messing around for the past couple of days trying to figure out what the best approach for my problem.  So here is what I'm trying to accomplish.  I have multiple rows which contains sums for different columns and one of the columns contains the maximum of the sums. 
    For example:
    ROW 1           SUM (A)             SUM(B)             SUM(C)            MAX(sum(a), sum(b), sum(c))<----
    Formula Variable 1
    ROW 2           SUM (A)             SUM(B)             SUM(C)            MAX(sum(a), sum(b), sum(c))<----
    Formula Variable 2
    ROW Total      SUM (1A2A)     SUM(1B2B)     SUM(1C+2C)     Result of Row 1 + Result of Row 2
    What I did was create a formula variable that evaluates the maximum of those rows and have a summary row, that keeps a running total.  I'm not sure how to store the result of that formula variable in the running total since the formula variable isn't an option to select.  Does anyone have a suggestions if this is a good approach or if there's another way to approach it?

    For each value you enter into scores.text, end it with a
    +"\n"
    as in...
    scores.text = String(1100) + "\n";
    scores.text += String(2200) + "\n";
    scores.text += String(1500) + "\n";

  • Order top down for a running total

    HI Is it possible to do this. I have a running total for the amt column of the row. There is one group, the transaction code. is it possible to order the data according to the amount column from high to low?

    hi Paul,
    a group cannot unfortunately be sorted on anything that is considered whileprintingrecords...e.g. running totals, shared vars.
    however, if this is a requirement then you can pass the sort criteria to a subreport and then use the subreport to display your data. the subreport is then sorted using this criteria (rolled up in a string running total) and the main report is suppressed.
    as an example, have a look at the attachment...extract the contents and change the .txt extension to .rpt.  there are some instructions on the report as to how to use the above technique.
    your other choice is to create the report off of a Command object and create the running total in the command object.
    SQL Expressions can sometimes be used (depending on your database) to bring in RT data but require a Select statement inside the expression  which is unfortunately not supported. so a Command would be recommended should you wish to do this with SQL.
    cheers,
    jamie

  • DISPLAY RUNNING TOTAL IN GROUP HEADER

    Post Author: sharonmtowler
    CA Forum: Formula
    I know there is a way to do this, just forgot how. i am in version 8.5.  i have a manual running total which calculates order qty for the entire sales order.i (dont like using the rt wizard-buggy)
    the knowledge base says to use a cross tab, but there hit or miss also.
    does anyone know how to show the display formula for a manual runnning total in the group header instead of group footer?

    Post Author: pandabear
    CA Forum: Formula
    Hi Sharon,
    I wanted to try this before I sent it to you, but my Crystal is down because (blah, blah, long story here....yawn....).
    I think I understand.  You want to show the "Total" for each group, in the group header instead of the group footer?
    My experience is that Crystal works from the top down (read: limiting), so I need a work around to do this.
    1 - Do the calculation in the query...sum by group, filter with a "Case" statement, etc.  If there's a reason you can't do that then
    2 - (and this is what I wanted to try first) see if you can group on the same field twice. 
    Group 1 - Test.field
    Group 2 - Test.field (same field)
    If you can,
    then just carry the total from the group footer of the previous group (same field) above you, and bring it down
    (shared var ?) to the group below.
    My 2 cents is up.
    Hope this helps,
    The Panda

  • Formula Help - Running Total vs ???

    Post Author: schilders
    CA Forum: Formula
    Good Morning All,
    I'm creating a report that contains a field called CDM Item.  This field indicates whether a particular order set was used for a given record.  Valid entries for this field are numeric 6 through 9.  I would like to create a formula that tells me the number of records that have a cdm item = 6, another formula that tells me the number of records that have a cdm item = 7 etc.  I need to summarize these formulas into pre-defined groups. 
    I was thinking a running total or a manual running total would be useful here.  However, I wanted to get some input from other formula gurus here.  Thanks, in advance, for your help.

    Post Author: yangster
    CA Forum: Formula
    You don't need to create a manual running total for what you are after.simply create 4 running totals ( 1 for each item number) using a running total with the evaluate formula of cdm =  6 (changed for each number)and resetting after whatever grouping you needthe other alternative you could implement if you have mutliple grouping and wanted subtotals on differing levels is to create a formula for each case such as@case_cdm6if cdm = 6 then 1 else 0then insert sum for each formula on all the differing group levels that way you only have to worry about maintaining one formula if the criteria changes

  • 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

  • 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

  • Running Total does not reset when group changes

    I have a manual running total for group3 that does not reset for group2
    Group2 Header (Order Status 3=Open,4=Closed)
    WhilePrintingRecords;
    currencyVar WIP=0;
    Group3 footer (Order Number)
    WhilePrintingRecords;
    currencyVar  WIP;
    WIP := WIP + {@NETWIP}
    Group2 footer
    WhilePrintingRecords;
    currencyVar WIP;
    There are no Repeat Group header on any of the groups
    Will add Group1 total when this part works.

    I am not sure if you made a typo when making your post but you are missing a colon when resetting your variable
    change from this
    currencyVar WIP=0;
    to this
    currencyVar WIP:=0;

  • Running Total Value or Zero

    Post Author: jligget
    CA Forum: Formula
    Good afternoon,
    I have a 2 running totals that sums either debits or credits. There may be cases where there are no credits so in place of the sum I need to place zero's.
    The running total has a formula in it of {@detail transaction code} in &#91;'22', '32'&#93; and if so it then sums the amount field. (22 or 32 desingate a credit - I have another running total for a debit)
    The problem is that if no credits exist nothing gets summed and I get spaces in my running total field. How can I make it so that it will display zeros instead?
    Thanks,
    Jeannette

    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?

  • Running Total not working correctly

    I have a running total setup inside a for loop, the problem is that the running total isn't "running" . Below is the syntax
    <?for-each@section:xdoxslt:foreach_number($_XDOCTX,1,3,1)?>
    <?xdoxslt:set_variable($_XDOCTX,’DUPE’, xdoxslt:get_variable($_XDOCTX, ‘DUPE’ ) +1) ?>
    <?for-each-group@section:/ TMP008/LIST_G_ORDER_BY/G_ORDER_BY/LIST_G_INVOICE/G_INVOICE;G_INVOICE?>
    TABLE HERE+_
    <?end for-each?><?end for-each?>
    I am using this loop to print 3 copies of an invoice, then by using the running total I am trying to call a unique footer on each copy by having the following code in the footer.
    <?choose:?>
    <?when: xdoxslt:get_variable($_XDOCTX,’DUPE’)=”1”?>
    <?call:Footer1?>
    <?end when?>
    <?when: xdoxslt:get_variable($_XDOCTX,’DUPE’)=”2”?>
    <?call:Footer2?>
    <?end when?>
    <?otherwise:?>
    <?call:Footer3?>
    <?end otherwise?>
    <?end choose?>
    What is happening is the first copy is using Footer 3 and the other 2 copies are using Footer 1. FYI at the top of the rtf I have a import statement and set_variable statement as shown below:
    <?import:file:///C:\Documents and Settings\username\Desktop\MasterFooter.rtf?>
    <?xdoxslt:set_variable($_XDOCTX,’DUPE’, 0)?>
    The variable DUPE is getting the value 1 on every page which I don't quite understand.
    Any help would be greatly appreciated. I can attach the xml file and rtf if so desired. Thanks

    First initialise a variable and assign it value zero (with this code..)
    <?xdoxslt:set_variable($_XDOCTX, 'RunTotVar', 0)?>
    then embed the following code within the for loop where you want the running total displayed..
    the code below shows a running total for the xml field INVOICE_AMT
    <?xdoxslt:set_variable($_XDOCTX, 'RunTotVar', xdoxslt:get_variable($_XDOCTX, 'RunTotVar') + INVOICE_AMT)?><?xdoxslt:get_variable($_XDOCTX, 'RunTotVar')?>
    Hope this helps. its from one of the examples provided with the template builder for word.
    -Domnic

  • How can implement running total in oracle forms

    I want to implement a running total in oracle form
    like
    100 100
    300 400
    200 600
    500 1100
    200 1300
    100 1400
    PROCEDURE calculate_srno IS
    current_rownum     integer:=:System.Cursor_Record;
    starting_srno integer:=:rs_1;
    last_rownum integer;
    BEGIN
         last_record;
         last_rownum:=:system.cursor_record;
         go_record(1);
         FOR counter IN 1..last_rownum LOOP
              :sum_1:=:rs_1;
              :rs_1:=:sum_1+:rs_1;
         --     :offered_srno_to:=starting_srno;
              if last_rownum=:System.Cursor_Record then exit;
              end if;
         END LOOP;
    END;
    it is not working after want to insert between in the table

    Why write code for this? Oracle Forms 10g has Calculated/Summary fields that will do this for you without the need of writing any PL/SQL.
    Simply add a non-table item to the data block with the item you want to keep the running total for. Then change the following properties of the item:
    Data Type: Number
    Calculation Mode: Summary
    Summary Function: Sum
    Summarized Block: <Your Data Block>
    Summarized Item: <Your Block Item>
    Number of Items Displayed: 1 (if your item is in a Multi-Record (Tabular) layout else you don't need to change this property.
    You will also need to change the following property of the block: Query All Records: Yes
    If changing the Block's "Query All Records" property causes your form to be too slow because of the number of records in your block, then you could keep a running total manually by using a combination of the Post-Query and When-Validate-Item (WVI) triggers. If your block does not allow data entry, then you could do this with just the Post-Query trigger. For example:
    BEGIN
      /* This code sample assumes you have added a non-table item */
      /* to your block called SUMMARY.  */
      :YOUR_BLOCK.SUMMARY := :YOUR_BLOCK.SUMMARY + NVL(:RS_1,0);
    END;If your block allows data entry, then you would add the following to your existing WVI trigger.
    BEGIN
      /* Perform your data entry validation logic first... */
      IF ....
      ELSE
        ...Validation is successful...
        :YOUR_BLOCK.SUMMARY := :YOUR_BLOCK.SUMMARY + NVL(:RS_1,0);
      END IF;
    END;Hope this helps.
    Craig...

Maybe you are looking for

  • How do I find where a program is in the menu so I can run it?

    Hello, When I go to System Administrator > Concurrent > Program > Define I can lookup programs that I should be able to run. Now I want to actually run the process but I cant find figure out what responsability it is under. How can I go about finding

  • Why does Safari crash?

    Why does Safari crash on my internal start-up disk and not on a booted SuperDuper external disk? Safari started behaving weird with very high CPU usage, then it refused to start up altogether, it doesn't even reach the safari icon when it crashes. Di

  • Core dump are creates even though my server does not crash

    I am having an issue with a large number of core dump files getting generated by jrockit that occupies the disk space daily almost 8 files are generated of size 150 to 800 MB However, what amazes me is that the weblogic server does not crash I have a

  • Row-wise Initialization: Use caching

    We have the 'Use Caching' check box available for row-wise initialized system variables. Although I do understand how this is useful as it shortens the login time for users who have logged in before by initializing the session variable from the cache

  • Where has the back arrow gone? No help from suggested change to tab preferences

    I also have lost the back arrow in Safari 6.0 running under Mountain Lion. Change of tab in preferences does not seem to help.