Counting the number of detail records at target side...

Hi
I have a requirement where i need to caluclate the number of detail records formed and add it in trailer section...both at target side...
The output will look like this :
<Detail>
    <Field></Field>
</Detail>  
<Detail>
    <Field></Field>
</Detail>
<Detail>
    <Field></Field>
</Detail>
<Trailer>
   <Count> 3 </Count>
</Trailer>
Basically, In trailer the Count field will contain the number of Detail records.
Can this be achived by a UDF?? Please help!!!

Actually teh detail node formation at target depends on a lot of nodes of source side...using Count I have already done it but due to lot of nodes @ source side it becomes kind of a mesh...
Hence I was trying to figure out a way in which if I can count the number of detail nodes at target side I can remove the present mapping...
Corect me if I am wrong but can't we declare this target detail node as global variable and then use 'Count' function to capture its occurence???
P.S : In XI 3.0 we used to have a tab to declare global variables but here in 7.1 we have Functions tab...could anybody tell me how to declare the variable in 7.1?

Similar Messages

  • Count the number of records

    Hi all,
    I have a BEx report that displays a list of empnos and their details based on a selection. Now I want to count the number of recrods that were selected and display the total number of records that were selected. How can this be done?
    Thanks,
    Sam

    Dear all,
    Thanks for the suggestions. Actially I had solved it in another way.
    As suggested by Sharma, I had used a CKF as count, But i did not want the empnos to come as the rows with 1 displayed across each row.
    I was trying to bring a summary in there.
    So I had created a structure in Rows and in the structure created a new selection and in that selection included Employee.
    This solved the problem that I was facing.
    Thanks everyone for your time and effort!!
    Cheers,
    Sam

  • How do I count the number of records returned in the CMIS query

    How do I count the number of records returned in the query CMIS?
    SELECT COUNT(*) FROM ora:t:IDC:GlobalProfile WHERE ora:p:xRegionDefinition = \'RD_PROJETOS_EXCLUSIVOS\''}
    Euler Homero

    Hi Euler,
    interestingly enough, the reference guide for CMIS ( http://wiki.alfresco.com/wiki/CMIS_Query_Language ) that I found does not mention the COUNT function at all. On the other hand it states that: "The SELECT clause identifies which virtual columns to return in the result set. It can be either a comma-separated list of one or more queryNames of properties that are defined by queryable object types or * for all virtual columns."
    There are, however, some other posts like e.g. http://alfrescoshare.wordpress.com/2010/01/20/count-the-total-number-of-documents-in-alfresco-using-sql/ which state that they could make it working.
    Having asked in the WebCenter Portal forum, I assume that your content repository is WebCenter Content. The CMIS doc for the Content is available here: http://docs.oracle.com/cd/E23943_01/doc.1111/e15813.pdf (no COUNT there either). It does, however, mention explicitly that "CMIS queries return a Result Set where each Entry object will contain only the properties that were specified in the query.". This means your could rather investigate the Result Set. Note that there are also other means than CMIS how to get the requested result set (e.g. calling a search service directly via so-called RIDC).
    In the given context I am also interested what your use case is. OOTB CMIS in WebCenter Portal is used, for instance, in Content Presenter, where it is content rather than "parameters" what's displayed.

  • The number of details is not matching with the total count.

    Hi all, again stuck with the code.
    There is a form where i have to populate all the details of few tables in excel & there is a report where i have to make count of all these details.
    The problem here is the number of details that is populated in excel is not matching with the count in report, both have to match. There some problem in code, please help me in matching it.
    The below is the 5 tables with the columns below.
    Tables are ENQACEDTL, ENQACEHDR, ENQACMDTL, ENQACMHDR, ENQACSPEC:
    The Names mentioned below the table's name are Column Names:
    ENQACEDTL
    ENQACEHDR
    ENQACMDTL
    ENQACMHDR
    ENQACSPEC
    ENQNO
    ENQNO
    ENQNO
    ENQNO
    ENQNO
    ENQAMDNO
    ENQAMDNO
    ENQAMDNO
    ENQAMDNO
    ENQAMDNO
    ENGREF
    ENGREF
    QTY
    OFFREF
    MINSL
    ITEM
    EPREPBY
    ITEM
    BRANCH
    EINSL
    FRAME
    DEPT
    RATING
    DEPT
    MTEMP
    TECOLD
    ENGREFTDT
    ENCLIP
    MKTREF
    ETEMP
    THE BELOW IS THE SELECT STATEMENT CODE FOR POPULATING DATA IN EXCEL:
    SELECT ENQACEDTL.ENQNO, ENQACEDTL.ENQAMDNO, ......... (....ALL COLUMNS)
    FROM ENQACMHDR,ENQACMDTL,ENQACEHDR,ENQACEDTL,ENQACSPEC
      WHERE
      ENQACMHDR.ENQNO=ENQACMDTL.ENQNO  AND
      ENQACMHDR.ENQNO=ENQACSPEC.ENQNO  AND
      ENQACMHDR.ENQAMDNO=ENQACSPEC.ENQAMDNO AND
      ENQACEHDR.ENQNO=ENQACSPEC.ENQNO  AND
      ENQACEHDR.ENQAMDNO=ENQACSPEC.ENQAMDNO AND
      ENQACMHDR.ENQAMDNO=ENQACMDTL.ENQAMDNO AND
      ENQACMHDR.ENQNO=ENQACEHDR.ENQNO  AND
      ENQACMHDR.ENQAMDNO=ENQACEHDR.ENQAMDNO AND
      ENQACEHDR.ENGREF=ENQACEDTL.ENGREF AND
      ENQACMDTL.ITEM=ENQACEDTL.ITEM AND
      ENQACMHDR.DEPT=:PROC_DEPT AND
      ENQACEHDR.ENGREFDT BETWEEN :FROMDATE AND :TODATE
      ORDER BY ENQACMHDR.ENQNO,ENQACMHDR.ENQAMDNO;
    THE BELOW IS THE SELECT STATEMENT CODE FOR COUNT OF DETAILS IN REPORT:
    SELECT ALL  ACENQ.ENQACEHDR.DEPT, COUNT(ACENQ.ENQACEHDR.ENQNO) COUNT
    FROM ACENQ.ENQACEDTL, ACENQ.ENQACEHDR
    WHERE (ACENQ.ENQACEDTL.ENGREF=ACENQ.ENQACEHDR.ENGREF)
    AND ENQACEHDR.LOCKE=1 AND
    ENQACEHDR.ENGREFDT BETWEEN  :P_STDATE  AND :P_ENDDATE
    GROUP BY ENQACEHDR.DEPT;
    There is problem in join condition of 1st code that is in the "SELECT STATEMENT CODE FOR POPULATING DATA IN EXCEL":
    Please help me to sort out this problem..
    Thank You.
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    Oracle Forms & Reports Builder 6i.

    As Karthick points out, we cannot help if we cannot see your correct table structures (create table statements) and some example data and expected output (insert statements would be helpful).  You're telling us there's a problem, but we cannot see what the problem is as you've not shown it.  Just saying your query is not working is like me telling you my car is not working, but not telling you what the symptoms are.  You wouldn't know where to start in fixing it.
    Why are you using Oracle 9.2.0.1 ?  Not only has that version been unsupported for about a decade, but 9.2.0.7 was the first version of 9i that was considered 'stable' as versions prior to that were considered buggy.  So you're using an old, unsupported and buggy version of oracle.  Seriously, you need to consider upgrading to a supported version, preferably at least the latest 11g version.
    And what has oracle Forms and Reports got to do with the issue?
    And please explain how you are getting your data out of Excel and presenting it to Oracle to be able to query against it.  Excel does not have "tables", so your question is completely unclear how you are querying the data from Excel.

  • Count the number of records between two key values (BTREE)

    How can I count the number of keys between two values?
    I'm using python driver, and BTREE access method.
    ====>
    ideally what I want is to average a whole time-series data set (the intervals can change) to a given number of points. The keys are the time stamps and the values are the data that needs to be averaged. I need to count the number of records between two time stamps so that I can divide that number by the number of points i need, and average the data. What is the best way to do this?  Or should I just keep the intervals for the time stamp constant and use RECNO access method?
    Thank you
    (first post btw.. and why aren't there many people in stackoverflow who answer Berkeley DB questions?)

    BDB is an embedded db and it does not have any internal counters or statistics that you could grap to use for this.    You will need to do it manually.
    You can create a cursor, grap the records you want, each time you get the next record you bump a counter.
    If you are using RECNO, you can use a cursor to get the record number of the record (DB_GET_RECNO), and if all you data is in
    sequentail records with no missing records you can figure out the total count by take last rec # - initial rec # + 1 to get a total count.
    If you switch over to the SQL API, you can issue a SQL query to give you a count.  Select count(*) Where .......
    Since you have to grab the data anyway, then best may be to count records as you go along.
    thanks
    mike

  • How to count the number of instances a record appears in a string

    I have a move that imports Name, Department and Site from an
    external CSV file, this part I managed to get working after many
    weeks. I would like to be able to count the number of instances of
    a specific Site “Glasgow” appears in the String. This
    way I know how many lines to set.
    Also can you add Dynamic text to a rollover button? I can get
    the the text to display on the root but not on a button.
    I am new to programming and Flash so apologies in
    advance.

    Those which took time to read carefully *_iWork Formulas and Functions User Guide_* are aware of the availability of wildcard characters.
    =COUNTIFI(range;"=text")
    will do the trick.
    Yvan KOENIG (VALLAURIS, France) lundi 26 avril 2010 17:36:34

  • Count the number of instances a record appears in a string

    I have a move that imports Name, Department and Site from an
    external CSV file, this part I managed to get working after many
    weeks. I would like to be able to count the number of instances of
    a specific Site “Glasgow” appears in the String. This
    way I know how many lines to set.
    Also can you add Dynamic text to a rollover button? I can get
    the the text to display on the root but not on a button.
    I am new to programming and Flash so apologies in
    advance.

    Hi,
    length(REGEXP_REPLACE(':XXX:CCC:BBB:','[[:alnum:]]'))counts all kinds of punctuation, spaces, etc., not just colons. Change any (or all) of the colons to periods and it will still return 4. Use '[^:]' instead of '[[:alnum:]]' if you really want to count just colons.
    Also, "SELECT ... FROM dual" is usually needed only in SQL*Plus or similar front end tools. In PL/SQL, you can call functions without a query, like this:
    x := NVL (LENGTH (REGEXP_REPLACE (txt, '[^:]')), 0);

  • System Extract - Incrementing a sequence number in detail record layout

    I have a system extract for a bank that requires a file header, batch header, detail, batch trailer and file trailer record. The detail record is at the run result level as I am looking to choose all records for a particular deduction (savings bonds) and I also have to put employee ssn and full name. This is working fine. I also have to put a sequence number, ie. detail record layout is record type, length 2, string, record sequence number, 5, ?????, employee SSN, length 9, field, employee full name, length 9, field. I need to increment the record sequence number by one for each detail record in the file. Ie. detail record 1 has record sequence number of 00001, detail record 2 has record sequence number of 00002.
    What type of data element would I set up? For this particular field, I don't need to go against a database field, I only need to keep track of the previous record's sequence number so that I can keep incrementing by 1 until all detail records have been written. The batch trailer has a record count of the number of detail lines and that works fine because I've set that up as a type 'total' with a 'count' of the detail records. I also have in the batch trailer a sum of the pay values from each of the detail records and that works fine as subtrailers allow total data elements where detail records do not.

    You can use any of the below mentioned 2 options in the ctl (Control) file:
    1. SEQUENCE(1,1)
    2. "xxcust_autoinv_seq.nextval"
    where xxcust_autoinv_seq is a database sequence.
    Thanks,
    Angelica.

  • How to count the number of rows in a cube!!??

    Experts,
    I can somebody tell me how do I count the number of rows in my cube when i am using listcube???..
    Thanks
    Ashwin

    Hi,
    have a look ath this theard too
    Number of Records in Cube
    regards

  • How to count the number of rows in a resultser object?

    hi there
    how to count the number of rows in a resultser object which may contains millions of rows? besides using a while loop? thanks

    You don't, you execute a query whose result is the record count of those records that match the search and then you execute the actual query to create your record set. Typically you do
    select count(id) from YourTable where [filter]
    from the resulting ResultSet do
    int res.getInt(1);
    which gives you the count and then
    select id from YourTable where [filter]
    to produce the actual result set.
    in the second query the id part can be substituted with the actual fields you want.

  • Need to count the number of groups in a Crystal Reports 2008 report

    I have created a report with three levels of grouping. There are several items in each level.  I want to count the number of groups.  I have tried countdistinct but it counts the number of items in the lowest level of grouping and I want the number of items in the higher  levels.  This is a distribution data base.  I have the data grouped by date, by truck on each date, and by "run" or load on each truck on each date.  I want to count the total number of groups of truck and run, which is the second level of the grouping.  Any ideas? I am fairly new to Crystal.

    Hi Debbie,
         To count the number of groups please try the folling steps:
    1) Create a formula @reset and place this formula in the page header
        whileprintingrecords;
        numbervar i:=0;
    2) Create another formula @evalgroup place this in the group header where you want to count the values.
        whileprintingrecords;
        numbervar i:= i+1;
    3) Create another formula @display and place this in report footer.
        whileprintingrecords;
        numbervar i;
    In order to display the count of details which are printing in the detail section place the eval formula in the detail section and the @display formula in the group footer.
    Hope this helps!!!
    Regards,
    Vinay

  • Need to count the number of times the Basic Finish data chages

    HI Expertes,
    I have a requirement I need to count number of times the Basic finish date chaged for PM work order. I went throug our forums I got some info like using a standard function module
    CHANGEDOCUMENT_READ_HDRS_ONLY
    CHANGEDOCUMENT_READ_HEADERS
    CHANGEDOCUMENT_READ_POSITIONS
    But all the above function module will not be suitable for my requirement since  CHANGEDOCUMENT_READ_HDRS_ONLY it gives whole changes but my requirement is just need number of changes occurred in Basic Finish date but CHANGEDOCUMENT_READ_POSITIONS can give the filed number which has been changed but still I need change id.
    So kindly suggest me wether there is any other Standard FM to get number of changes occurred in Basic Finish date?
    Thanks,
    Rajesh

    Hi Debbie,
         To count the number of groups please try the folling steps:
    1) Create a formula @reset and place this formula in the page header
        whileprintingrecords;
        numbervar i:=0;
    2) Create another formula @evalgroup place this in the group header where you want to count the values.
        whileprintingrecords;
        numbervar i:= i+1;
    3) Create another formula @display and place this in report footer.
        whileprintingrecords;
        numbervar i;
    In order to display the count of details which are printing in the detail section place the eval formula in the detail section and the @display formula in the group footer.
    Hope this helps!!!
    Regards,
    Vinay

  • Count the number of days in the selected range using Customer exit

    Hi Experts,
    we have requirment where user is asking to add a column to report, which will have 'count of days for which key figure is having values' for each of the months and the Header would be 'Day Count'
    Please let me know if its possible using Customer exit?

    Hi,
    In our report we have two characteristics site no. and product and we have 6 key figures of type quantity and Input for the report is Fiscal year/period
    So in the report Key figures are populated with values for respective site no. and product combination
    Now the user wants new column in report which will have header u2018Day countu2019 and it should Simply count the number of days in the selected range that have a volume different than 0 for key figure
    Please let me know if more details are required

  • How to count the number of Rows to be Updated before Update takes place..

    Hi all,
    I have a requirement, where i have to count the number of rows to be updated before updating it. SQL%ROWCOUNT gives the no. of rows updated ( after update takes place). How do i get to know the count of no. of rows to be updated/inserted/ deleted. I was looking for a simple solution, as above SQL%Rowcount. But i couldn't find any. I can use a Function and Return the value which will give me number of rows to be updated, But is there any Simple Logic other than this.. or any count function. Your Help is Appreciated. Thanks!

    If you really want to do this (I have no clue why you would need it), then you can piggy back on any existing pessimistic locking you may already have in place.
    However, it would require two loops through the records of which you want to know the count before you update, and a second pass to update them.
    I would really re-think the need for this, though.
    SQL> create table t0304(c number);
    Table created.
    SQL> insert into t0304 select rownum from all_objects where rownum <= 10;
    10 rows created.
    SQL> commit;
    Commit complete.
    SQL> select * from t0304;
             C
             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
    10 rows selected.
    SQL> declare
      2    cursor mycursor is select * from t0304 where mod(c,2) = 0 for update;
      3    i number := 0;
      4  begin
      5    for r in mycursor loop
      6      i := i + 1;
      7    end loop;
      8    dbms_output.put_line(i);
      9    for r in mycursor loop
    10      update t0304 set c = c + 20 where current of mycursor;
    11    end loop;
    12  end;
    13  /
    5
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL> select * from t0304;
             C
             1
            22
             3
            24
             5
            26
             7
            28
             9
            30
    10 rows selected.
    SQL>Edited by: Steve Howard on Mar 4, 2011 5:57 PM

  • Count the number of docs

    Hello,
    Is there anyway that we can aount the number of documents when we run a query..Like can we introduce any key figure in the query whose function will be to count the number of docs.PLease let me know.
    thanks

    Hi,
    In Infocubes, DSO's there will be a Keyfigure called as Number of Records.
    You can use that KF in your Query as Restricted Key Kigure.
    For eg : You need the total count of employees
    Then you need  to the use the KF no.of records with the 0employee char.
    Hope this will helps you ....
    Thanks and Regards
    Ashwin

Maybe you are looking for

  • Different date formats

    Want to find out what format was used in the access database for date fields. I had loaded the data from access to oracle temporary table by making all fields(columns)as character types and now trying to load in to actual tables in Oracle. The conver

  • Preview don't work well in exhibit exif parameters

    If I choose italian language preview don't show exif parameters. Instead if i put english language, all is ok. Someone knows haw resolve this issue? thanks

  • Oracle Intelligent Agent Startup Error

    Whenever I try to startup the Oracle Intelligent Agent on my DB server I get the error: could not open emtab at /var/opt/oracle/emtab. I am using Oracle9iR2 and have installed the complete package. I did a search of the HD and this file does not exis

  • No AirDrop on MacBook Air 2008

    On my MacBook Air is no AirDrop available in the Finder. I heard that some Wifi Firmware Versions aren't compatible with AirDrop, I have: Broadcom BCM43xx 1.0 (5.10.131.36.11) Any idea, why this doesn't work?

  • Unusually high CPU usage in Snow Leopard (10.6.1)

    I upgraded from Leopard to 10.6.1 and the fans started to run a lot more often then they did in Leopard. I checked 'Activity Monitor' and the processes that usually were consuming 99-100% CPU and heating up the notebook were Dashboard Client or Syste