Single row table with for-each group loop to set variable.

Hi: There is probably a simple answer for this but I have not found it ...
I have a single row table to loop through a group to set a variable holding a running amount. I am not displaying the amount within the table however when I preview the report I see that the table is expanding (adding rows) for each loop.
The single row table has 3 columns.
1st column
<?for-each:AC_GROUP?>
2nd column
<?xdoxslt:set_variable($_XDOCTX,'xAmtVar',xdoxslt:get_variable($_XDOCTX,'xAmtVar')+CURRENT_AMOUNT)?>
3rd column
<?end for-each?>
Should I be using <?for each-group?> or something else. My requirement is to set the value of the variable with the running total but because the loop is adding rows for each value it loops through (even though not displayed), it is moving other areas of the layout off the page.
Hope this makes sense. Thanks in advance.

you can do it many ways.
No need to loop
You can create a variable and put the sum amount directly in that.
<?doxslt:get_variable($_XDOCTX,'xAmtVar',sum(/AC_GROUP/CURRENT_AMOUNT))?>or
loop thru and add like you do.
<?for-each@inlines:AC_GROUP?><?xdoxslt:set_variable($_XDOCTX,'xAmtVar',xdoxslt:get_variable($_XDOCTX,'xAmtVar')+CURRENT_AMOUNT)?><?end for-each?>do give any space or enter character in word between them, just put this in a single form-field will do
But as i said, i would certainly go with first option.

Similar Messages

  • How to use single buffered table with FOR ALL ENTRIES KEYWORD

    Hai,
    I'm Using TJ02T Database table, It is single buffered table but at the same time I want to use FOR ALL ENTRIES KEYWORD , Please Help me.
    Regards,
    S.Janani

    Hi,
    FOR ALL ENTRIES will not depend on the buffering nature of the table. The single buffered table will only only buffer one record into memory. You can still use the statement to query the values, but it may have performance problems if the data volume is high since the records are not completely buffered into memory, the time will spent in getting data from DB.
    Thanks..
    Preetham S

  • Fixed length outer table with nested repeating group inner table.

    I had to re-create a PDF using tables in an RTF template. It has a fixed 1 page width. However, one of the rows in the template has a nested table with a repeating group. I set the width of the outer table row width to 2". However when I have repeating groups it makes the outer row grow wider than the 2" inches. The option to un-select "automatically resize to fit contents" is grayed out.
    Is there a way to keep the outer table width fixed with an inner repeating group?
    Thanks.
    --Johnnie
    Edited by: Vortex13 on Jun 13, 2012 11:15 AM

    Hi Borris,
    Found the following in the Oracle Documentation under: Oracle8i Application Developer's Guide - Object-Relational Features Release 2 (8.1.6)
    2 Managing Oracle Objects / Using Collections / Collection Unnesting
    URL: http://www.znow.com/sales/oracle/appdev.816/a76976/adobjmng.htm#1002885
    Oracle8i also supports the following syntax to produce outer-join results:
    SELECT d.*, e.* FROM depts d, TABLE(d.emps)(+) e;
    The (+) indicates that the dependent join between DEPTS and D.EMPS should be NULL-augmented. That is, there > will be rows of DEPTS in the output for which D.EMPS is NULL or empty, with NULL values for columns
    corresponding to D.EMPS.

  • Getting the first row for each group

    Hi Everyone,
    I have a query which returns a number of rows, all of which are valid. What I need to do is to get the first row for each group and work with those records.
    For example ...
    client flight startairport destairport stops
    A fl123 LGW BKK 2
    A fl124 LHR BKK 5
    B fl432 LGW XYZ 7
    B fl432 MAN ABC 8
    .... etc.
    I would need to return one row for Client A and one row for Client B (etc.) but find that I can't use the MIN function because it would return the MIN value for each column (i.e. mix up the rows). I also can use the rownum=1 because this would only return one row rather than one row per group (i.e. per client).
    I have been investigating and most postings seem to say that it needs a second query to look up the first row for each grouping. This is a solution which would not really be practical because my query is already quite complex and incorporating duplicate subqueries would just make the whole thing much to cumbersome.
    So what I really new is a "MIN by group" or a "TOP by group" or a "ROWNUM=1 by group" function.
    Can anyone help me with this? I'm sure that there must be a command to handle this.
    Regards and any thanks,
    Alan Searle
    Cologne, Germany

    Something like this:
    select *
    from (
       select table1.*
       row_number() over (partition by col1, col2 order by col3, col4) rn
       from table1
    where rn = 1In the "partition by" clause you place what you normally would "group by".
    In the "order by" clause you define which will have row_number = 1.
    Edit:
    PS. The [url http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions004.htm#i81407]docs have more examples on using analytical functions ;-)
    Edited by: Kim Berg Hansen on Sep 16, 2011 10:46 AM

  • ?for-each-group? dosen't work with page break - rtf template???

    Hello all,
    When I give a page break inside the for-each-group the group doesn't iterate any code after the page break. I can't give <?split-by-pagebreak?> in this case because I want that loop to be iterated for every department, and should show the report in one column(ms word column), and the department description in two columns.....as this has to happen for every department I can't write separate code........everything should go into one file......
    Final file should look like:
    <for every department>
    <department_report-a table>--one column(ms word column)
    <department_description-a huge text>--two columns(ms word columns)
    <next department>
    how can I achieve this - please help, its urgent.
    Thanks for your time.
    DK

    bipuser thanks for your response
    i will have table data also so i cannot keep in the same line.
    its strange for the last 2-3 days below syntax gave me space at the beginning of each group now it is working i didnt do any change
    <?for-each:G_1?>
    ABCDEFDG
    <?split-by-page-break:?><?end for-each?>

  • How to compare the value node of a for-each-group with other for-each-group

    Hello!
    I have a report in Oracle BI Publisher (10.1.3.2) with several data set. My XML schema is something like
    <DATA>
    <PARAMETERS>
    <MY_PARAMETERS>
    <A_ID>12345</A_ID>
    <DESCRIPTION>ABC</DESCRIPTION>
    <VALUE>111111</VALUE>
    </MY_PARAMETERS>
    <MY_PARAMETERS>
    <A_ID>12345</A_ID>
    <DESCRIPTION>DEF</DESCRIPTION>
    <VALUE>222222</VALUE>
    </MY_PARAMETERS>
    <MY_PARAMETERS>
    <A_ID>67890</A_ID>
    <DESCRIPTION>ABC</DESCRIPTION>
    <VALUE>333333</VALUE>
    </MY_PARAMETERS>
    </PARAMETERS>
    <NAMES>
    <MY_NAMES>
    <A_ID>12345</A_ID>
    <NAME>ASDF</NAME>
    </MY_NAMES>
    <MY_NAMES>
    <A_ID>67890</A_ID>
    <NAME>EFGH</NAME>
    </MY_NAMES>
    </NAMES>
    <VALUES>
    <MY_VALUES>
    <A_ID>12345<A_ID>
    <VALUE>10987</VALUE>
    <DESCRIPTION>ASDFG</DESCRIPTION>
    </MY_VALUES>
    <MY_VALUES>
    <A_ID>12345<A_ID>
    <VALUE>26385</VALUE>
    <DESCRIPTION>EFGHI</DESCRIPTION>
    </MY_VALUES>
    <MY_VALUES>
    <A_ID>67890<A_ID>
    <VALUE>24355</VALUE>
    <DESCRIPTION>ASDFG</DESCRIPTION>
    </MY_VALUES>
    </VALUES>
    </DATA>
    I'm trying to build a rtf template in Word using this XML schema. The "A_ID" nodes in each group in my data have the same value. I want for each "A_ID" take the respective values in /DATA/VALUES/MY_VALUES.
    <?for-each-group:MY_PARAMETERS;./A_ID?>
    <?for-each:current-group()?>
    <?choose:?><?when: DESCRIPTION='ABC'?>
    <?VALUE?>
    <?end when?><?end choose?>
    <?end for-each?>
    <?for-each:current-group()?>
    <?choose:?><?when: DESCRIPTION='DEF'?>
    <?VALUE?>
    <?end when?><?end choose?>
    <?end for-each?>
    <?/DATA/NAMES/MY_NAMES/VALUE?>
    <?for-each-group:/DATA/VALUES/MY_VALUES;./A_ID?>
    <?for-each:current-group()?>
    <?choose:?><?when: DESCRIPTION='ASDFG'?>
    <?VALUE?> <---------------- I obtain for this node the '24355' and '10987' values
    <?end when?><?end choose?>
    I want to know how to obtain only '24355' value, this is, the value for A_ID (/DATA/VALUES/MY_VALUES) = A_ID (/DATA/PARAMETERS/MY_PARAMETERS).
    Can someone help me?

    CREATE OR REPLACE TRIGGER "TEST_TRG"
       BEFORE UPDATE OF "STATUS"
       ON "TABLE1"
       FOR EACH ROW
    BEGIN
       IF (:NEW.status = 'HOLD')
       THEN
          INSERT INTO table2
                      (status
               VALUES (:NEW.status
       END IF;
    END;You should learn how to write PL/SQL code.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Adding a chart for each group in ssrs not below are above the group in group footer or header. but side of the table data

    Hi
    I am currently adding a chart for each group on group footer in a table.
    but i want that charts to be on the right side of the group data.
    regards
    Pratap M:)

    Hi PratapM,
    If I understand correctly, you have already added a chart in group footer, and you want to display the chart on the right side of the cell. If I have misunderstood, please don't hesitate to let me know.
    Based on my research, if we directly add a chart into a cell, the chart will fill all of the space in the cell. So in order to achieve your requirement, we can insert this chart into a rectangle, then add the rectangle to the group footer. If we want to
    display the chart on the right side, we can directly drag the chat to the right of the rectangle.
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Count() for each group, but only groups having 1+ element like... AND all elements like...

    There are tables(and columns) like:
    'Clients'(clientID)
    'Houses' (houseID)
    'Visits' (clientID, houseID, visit_date)
    'Contracts'(contractID, houseID, clientID, rentDate_from, rentDate_end)
    I have problem with writing MS SQL query of this kind:
    how many visits to houses did each client, before renting one of them?
    Its easy to count total number of Visits for each client, listing all visits + group by clientID and selecting count(*) for each group.
    Lets say this is select_1, and select_2 is listing all Contracts for all clients.
    Select_1 is not answer, because count must be performed only on groups, which:
    -have at least 1 row "like" row in select_2 (it means that at least one of visited houses was rented, because it can happen that client visited few houses, but rented other, not visited house). my idea for this is comparing select_1 and select_2 with:
    "where s1.clientID=s2.clientID and s1.houseID=s2.houseID"
    -each group must have all rows(visits) with date of same day or earlier than contract date
     maybe: "datediff(day, s1.visit_date, s2.rentDate_from) >= 0"

    In future, please provide proper DML, DDL and example data, like I have for you below.
    DECLARE @clients TABLE (clientID INT, name VARCHAR(20))
    INSERT INTO @clients (clientID, name)
    VALUES (1, 'Jonathan'),(2, 'Christopher'),(3, 'James'),(4, 'Jean-Luc'),(5, 'William')
    DECLARE @houses TABLE (houseID INT, address VARCHAR(20))
    INSERT INTO @houses (houseID, address)
    VALUES (1, 'NX01'),(2, 'NCC 1701'),(3, 'NCC 1071A'),(4, 'NCC 1701D'),(5, 'NCC 1701E')
    DECLARE @visits TABLE (clientID INT, houseID INT, visitDateTime DATETIME)
    INSERT INTO @visits (clientID, houseID, visitDateTime)
    VALUES (1,1,'2001-01-01 12:13:14'),
    (2,2,'2001-01-02 12:13:14'),
    (3,2,'2001-01-01 12:13:14'),(3,3,'2001-01-01 12:13:14'),
    (4,4,'2001-01-01 12:13:14'),(4,5,'2001-01-01 12:13:14'),
    (5,4,'2001-01-01 12:13:14'),(5,5,'2001-01-01 12:13:14')
    DECLARE @contracts TABLE (contractID INT IDENTITY, houseID INT, clientID INT, rentStartDate date, rentEndDate date)
    INSERT INTO @contracts (houseID, clientID, rentStartDate, rentEndDate)
    VALUES (1,1,'2001-01-02',NULL),(2,2,'2001-01-02',NULL),(3,3,'2001-01-02',NULL),(4,4,'2001-01-02',NULL),(5,5,'2001-01-02',NULL)
    SELECT contractID, c.houseID, c.clientID, rentStartDate, rentEndDate, cl.clientID, name, h.houseID, address, COUNT(v.clientID) AS visits
    FROM @contracts c
    LEFT OUTER JOIN @clients cl
    ON c.clientID = cl.clientID
    LEFT OUTER JOIN @houses h
    ON c.houseID = h.houseID
    LEFT OUTER JOIN @visits v
    ON c.clientID = v.clientID
    AND c.rentStartDate >= v.visitDateTime
    GROUP BY contractID, c.houseID, c.clientID, rentStartDate, rentEndDate, cl.clientID, name, h.houseID, address

  • Adding ssrs chart for each group under group footer

    Hi,
    I have requirement of report design, user has ability to select single or multiple product name in parameter and it should display column headers for each group and chart for each group (product name). 
    Report Design
    ProductName: A
    Category JAN
    FEB MAR
    Sales 10
    12 15
    Budget 20
    20 20
    Chart Here
    ProductName: B
    Category JAN
    FEB MAR
    Sales 10
    12 15
    Budget 20
    20 20
    Chart Here
    I want to repeat this for all products.
    Please anyone can provide steps to how to achieve this design?

    Hi Srikanth,
    According to your description, you want to design a tablix to display header and chart for each group in its group header and footer. Right?
    In Reporting Service, when we add header and footer for a group, the header row and footer row are still within this group. Anything we put in these two rows will be grouped. For your requirement, we created a sample report in our local environment. Here
    are steps and screenshots for your reference:
    1. Create a matrix. Columns are grouped by month. Rows are grouped by ProductName (with group header and footer).
    2. Put the text/field of the first row into the group (ProductName) header. Delete the header row of matrix (the first row), select Delete rows only.
    3. Insert a chart into the group footer. It looks like below:
    4. Add a parameter for filtering data. Save and preview it looks like below:
    Reference:
    Understanding Groups (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • SAP tables with &NC& Auth Group.

    In SAP there are about 7000 plus tables with &NC& Auth Group.
    Are all these tables not financial relevant.
    What is the impact if we change these tables auth group to custom auth groups?

    On their own they might not be finance relevant, but might even be system relevent for that matter.
    &NC& means "Not Classified" hich should be understood as "no intention to display and or change them from the application layer" as their single fields on their own are not usefull or inconsistent.
    The bugger is that if developers don't understand this and security folks don't respect it, then because of one single table you might open access to all other unclassified tables (depending on how they are designed in the Data Dictionary and how they are accessed).
    I have seldom seen a SAP system which got this right, primarily because of the developers (also the ones from SAP).
    Yes, you can change the groups is SE54. But report it to SAP and keep track of which SP level introduces the new check value. Try to obtain that information from them in advance if you need to, and check that it is conceptually consistent with your concept (minimum requirement is that it should not be conceptually inconsistent with other SAP standard concepts).
    If this is a topic for you and delivery classes also play a role, then also search OSS for the term "Current Settings". These give you more options - for specific objects.
    Cheers,
    Julius

  • Custom sorting within "for-each-group:current-group"

    Hi, I need some help in doing a custom sort within a "for-each-group:current-group". My formatting is in a table format but I'm not sure how to post a table here so I'm just arranging the column details out as it would look in a table. I have a column on the left for the YEAR and a second column on the right for the DESCR. Under the DESCR column I've inserted a nested table with four columns: SUBJECT, CATALOG_NBR, DESCR250 and GRADE.
    COLUMN 1:
    <?for-each-group:row_table;./ YEAR?><?sort: YEAR;'ascending';data-type='text'?><?YEAR?>      
    COLUMN 2:
    <?for-each-group:current-group();./DESCR?><?DESCR?>
    NESTED TABLE (with 4 columns):
    +<?for-each:current-group()?><?SUBJECT?><?CATALOG_NBR?><?DESCR250?><?GRADE?><?end for-each?>+
    <?end for-each-group?> <?end for-each-group?>
    I'm able to sort by YEAR in the "for-each-group" on the left column. But I also want to do a custom sort on DESCR in the right column.
    I've seen this blog on custom sorting by Vetriselvan: http://winrichman.blogspot.com/2009/09/custom-dynamic-sort-in-bi-publisher.html and I tried inserting this sort below after <?for-each-group:current-group();./DESCR?> but I get an error message.
    <?sort:(number(DESCR='Status')*1)+(number(DESCR='First Semester')*2)+(number(DESCR='Second Semester')*3);'ascending';data-type='number'?>
    I've also seen this thread: Re: Sort within group and tried inserting <?for-each:DESCR?> before the sort (as below) - this time I can preview the results, but it is not sorting as required.
    <?for-each:DESCR?><?sort:(number(DESCR='Status')*1)+(number(DESCR='First Semester')*2)+(number(DESCR='Second Semester')*3);'ascending';data-type='number'?>
    Can anyone help me custom sort the DESCR column? I'm using Template Builder for Word version 5.6 build 45. Thanks in advance for any help!

    Hi Vetsrini,
    I tried adding <?sort: ./DESCR;'ascending';data-type='text'?> after <?for-each-group:current-group();./DESCR?> but I'm getting an error message.
    The DESCR values are below and I'm trying to sort them in the following order.
    STATUS
    SUMMER SEMESTER
    FIRST SEMESTER
    AUTUMN SEMESTER
    WINTER SEMESTER
    SECOND SEMESTER
    SPRING SEMESTER
    Because I need them in the above order, I can't use ascending or descending, and instead need to use a custom sort order. Do you know how I can go about creating a custom sort order?
    Thanks!

  • Top N for each grouping?

    Is there a way to show in OBIEE the Top N results for each group?
    I want to show the top 10 amounts for each region in my table. If using a Top N filter, it returns the Top N overall results. I tried creating a pivot table and using 'Region' as the section separator, but got the same results. It's only returning 10 amounts total, and I want to see 10 amounts for each region.
    Kevin

    Yep,
    Use the by statement:
    TOPN("F1 Revenue"."1-01 Revenue (Sum All)", 10 by "D2 Market"."M01 Market")
    regards
    John
    http://obiee101.blogspot.com/

  • B1if - #sender system in for each processing loop

    Hi all,
    I am creating a scenario where I use the for each processing loop.
    Everything works fine but when I want to use the #Sender system in various steps (call B1 atom eg), I get an error saying the #Sender system is empty.
    Do I need to do something to get it populated inside the for each loop?
    Kind regards,
    Joeri

    Hi Joeri,
    I have done a test and I have the same problem you are having the system is empty when I use the #Sender System in a B1 call inside a for each. If I use a fix system id then it works fine.
    <?xml version="1.0" encoding="utf-8" ?>
    <Msg xmlns="urn:com.sap.b1i.vplatform:entity">
      <Body>
        <Payload Role="C" id="atom3" system="empty">
          <B1CallResult status="failure" b1login="Technical User" method="Synchronous Retrieval" objectid="4" payload="" keyname="ItemCode" keyvalue="A00001" />
        </Payload>
      </Body>
    </Msg>
    Please open a message for support asking for it and share the information with us.
    Hope it helps
    Trinidad.
    Edited by: Maria Trinidad MARTINEZ GEA on Jan 6, 2012 11:00 AM
    My previous answer was not related to your question...

  • Query to find the latest two transactions for each Group

    Hi All,
    Consider the following sets of records in a table test.
    Group---Tran_Dt---SlNo
    c1 10/10/2003 1
    c1 10/10/2003 2
    c1 10/10/2003 3
    c1 11/10/2003 1
    c2 10/10/2003 1
    c2 10/10/2003 2
    c2 11/10/2003 1
    c2 11/10/2003 2
    c2 11/10/2003 3
    c3 10/10/2003 1
    c3 10/10/2003 2
    c3 10/10/2003 3
    I want to list out the latest two transactions for each group irrespective of the slno and trans_dt as below:
    group tran_dt SlNo
    c1 11/10/2003 1
    c1 10/10/2003 3
    c2 11/10/2003 3
    c2 11/10/2003 2
    c3 10/10/2003 3
    c3 10/10/2003 2
    Any help on this would be appreciated.
    Thanks
    Walter Nicholas T

    Hi Walter,
    Please try following query.
    select Group,tran_dt,sino from
    select Group,tran_dt,sino,(DENSE_RANK()OVER (PARTITION BY Group ORDER BY tran_dt desc,sino desc)) rank from test
    ) where rank between 1 and 2
    Thanks,
    Samir

  • How to handle goup sub total for each group in oracle query ?

    hi,
    i want to handle one complex thing in oracle query.
    i have a grouping in my oracle query.
    i want to do sub total for each group in query and after that i want to subtract one group sub total from previous group subtotal ?
    so how can i handle this in oracle query ?
    any help is greatly appreciated.
    thanks.

    Hello
    Interesting requirement.
    I wonder why are you not using these calculation during the display time. If it is acceptable then you can try using the custom formula with the running total combination in crystral report to achieve to get the required results.
    Best regards
    Ali Hadi

Maybe you are looking for

  • Command to add multiple datafiles in multiple tablespace in one time.

    Send me command to command to add multiple datafiles in multiple tablespace in one time.

  • Problem with attachements in bid invitation

    I posted 3 attached documents in a bid invitation,1.xls,an 2 .doc ,the problem is that the supplier can't open the documents attached plus the documents are not big, can any one please help me with this issue? there will  be rewards.

  • My Nokia C3 is not supporting softwares

    I have tried so many ways to download softwares, but to my efforts are all fruitless. When i go to other sites to download and install softwares, the place to download the software will not even be active and when i download from ovi store it is not

  • FIXED! Another install failure issue

    I have a problem I haven't seen before. I have Windows XPSP2 and IE7. I am trying to use the standalone installer for Flash 9.0.47.0. Installing from the automated website doesn't work. It tells me that it failed. I used the official Adobe Flash unin

  • Issue with the template

    How to insert a table in the rtf template that already has a table..when I try to insert the table its showing to the left of the report when I view the output. I want it to display the table exactly where I placed it