Count the # of occurrences of a particular node value

Hi,
Is there an easy way to count the # of occurrences of a particular <sap_vendor_type> ?
E.g. 2 for 'head office' and 1 for 'order from'?
<sap_vendors>
     <sap_vendor sap_vendor_type='head office'>
          <sap_vendor_id>0001002788</sap_vendor_id>
     </sap_vendor>
     <sap_vendor sap_vendor_type='head office'>
          <sap_vendor_id>0002001234</sap_vendor_id>
     </sap_vendor>
     <sap_vendor sap_vendor_type='order from'>
          <sap_vendor_id>0003002345</sap_vendor_id>
     </sap_vendor>
</sap_vendors>
Thanks
Bac

you can use the standard count function (Statistics)

Similar Messages

  • Count the items in a column with multiple values?

    Hi all
    Is there a way to count the items in a column that allows multiple values?
    Example list:
    Course title:                        Participants:
    Visual Basic Introduction     John Smith; Lois Lane; Clark Kent
    Visual Basic Advanced         John Smith; Lex Luthor
    The result should be "3" and "2" (number of participants), which should be displayed in the list or on the page.
    Is this possible?
    ( I am using Sharepoint 2007 and have access to Sharepoint designer.)
    Thanks!

    Hi dee,
    We can use XSLT to do this in Data View Web Part.
    First, display your list in data view web part.
    Insert a new column in the data view, used to display the count.
    Switch to code mode, add following code within the <td></td>.
    <td>
    <xsl:choose>
    <xsl:when test="@Title!=''">
    <xsl:variable name="count">
    <xsl:call-template name="countChar">
    <xsl:with-param name="str" select="@Title" />
    <xsl:with-param name="count" select="1" />
    </xsl:call-template>
    </xsl:variable>
    count is <xsl:value-of select="$count" />
    </xsl:when>
    <xsl:otherwise>
    count is <xsl:value-of select="0" />
    </xsl:otherwise>
    </xsl:choose>
    </td>
    And put the following template definition outside all the other templates.
    <xsl:template name="countChar">
    <xsl:param name="str" />
    <xsl:param name="count" />
    <xsl:choose>
    <xsl:when test="contains($str, ';')">
    <xsl:call-template name="countChar">
    <xsl:with-param name="str" select="substring-after($str, ';')" />
    <xsl:with-param name="count" select="number($count) + 1" />
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$count" />
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    Done and then you will see the count in the td cell.
    I test with Title column and cut off string with ";" character.
    Thanks & Regards,
    Emir Liu
    TechNet Subscriber Support in forum
    If you have any feedback on our support, please contact [email protected] 
    Emir Liu
    TechNet Community Support

  • 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 do I count the number of times a particular year occurs in a range of dates?

    One column in my spreadsheet is a date and time.  I want to be able to count how many times a particular year occurs.
    Is there a way to combine the COUNTIFS and YEAR functions, or is there something easier to use?
    I'm using Numbers '09.
    Thank you for your assistance.

    You could use COUNTIFS with the two conditions being ">="&DATE(year, 1,1) and "<"&DATE(the next year, 1,1)

  • How to get the other columns of a particular mininum value

    <p>I have a multiple rows per account in a table. I build a object minimum(col1) in the Business Object universe. I need to get the corresponding values of a min(col1) for each account. Problem is when i pull the min(col1) and other column, it always gives every combination of the min(col1) for each account. How do i get only the corresponding values.</p><p>Example</p><p>Acct         Col1     col2     col3 </p><p>1              34       3         4</p><p>1              45        5        6</p><p>2               3         7         8</p><p>output should be</p><p>1           45    5   6</p><p>2         3       7   8</p><p>How i accomplish with data providers or free hand sql combinations</p><p>&#160;</p><p>Thanks</p><p>&#160;</p><p>&#160;</p>

    you can do this very quickly by creating a crosstab with the Acct as the Row, and Col1,2,3 as the Columns, and the Maximum of your field as the summary.

  • How to count the elements in a Source whith method count() ?

    hi all,
    I have a Source created by:
    Source s = m1.join(m2).join(m3).join(d1).join(d2);
    m1, m2, m3: MdmMeasure of the same Cube C1
    d1, d2: MdmPrimaryDimension of the same Cube C1
    I want to count the elements in this Source that have values so I used:
    s.count()
    I want to know the result of count() is the number of lines of m1 or m2 or m3?
    Whith the same source like this, can I count the elements of m2?? If it's possible, show me how to do it please!
    Always with the same source, is it possible to know which measure: m1 or m2 or m3 have the most elements not null?
    I can count the elements of each measure then compare its together but in my exercice, I have 20 measures so I find a method that avoid the most request and comparison!
    Thanks for your reply!

    hi all,
    I have a Source created by:
    Source s = m1.join(m2).join(m3).join(d1).join(d2);
    m1, m2, m3: MdmMeasure of the same Cube C1
    d1, d2: MdmPrimaryDimension of the same Cube C1
    I want to count the elements in this Source that have values so I used:
    s.count()
    I want to know the result of count() is the number of lines of m1 or m2 or m3?
    Whith the same source like this, can I count the elements of m2?? If it's possible, show me how to do it please!
    Always with the same source, is it possible to know which measure: m1 or m2 or m3 have the most elements not null?
    I can count the elements of each measure then compare its together but in my exercice, I have 20 measures so I find a method that avoid the most request and comparison!
    Thanks for your reply!

  • To count the elements in this Source

    hi all,
    I have a Source created by:
    Source s = m1.join(m2).join(m3).join(d1).join(d2);
    m1, m2, m3: MdmMeasure of the same Cube C1
    d1, d2: MdmPrimaryDimension of the same Cube C1
    I want to count the elements in this Source that have values so I used:
    s.count()
    I want to know the result of count() is the number of lines of m1 or m2 or m3?
    Whith the same source like this, can I count the elements of m2?? If it's possible, show me how to do it please!
    Always with the same source, is it possible to know which measure: m1 or m2 or m3 have the most elements not null?
    I can count the elements of each measure then compare its together but in my exercice, I have 20 measures so I find a method that avoid the most request and comparison!
    Thanks for your reply!

    Guys - Thanks for the quick response
    Bill - I think you are recommending the approach I had in the submitted code.
    David - the whole point is that I want to use the pipeline, not the Path argument, and I had no luck with your suggestion, which I took as:
            Get-ChildItem $from -Recurse  |
                Where-Object {(New-TimeSpan -Start  $_.LastWriteTime -End $cutoff).TotalHours -le 0} |
                ForEach-Object {Copy-Item -Path $_ -Destination {Join-Path $to $_.FullName.Substring($from.length)}; $fileCount++}
    However, all this did make me go read more documentation, and there is a -PassThru argument to Copy-Item which creates pipeline output after the copy.  Specifically:
            $fileCount=0
            Get-ChildItem $from -Recurse  |
                Where-Object {(New-TimeSpan -Start  $_.LastWriteTime -End $cutoff).TotalHours -le 0} |
                Copy-Item -Destination {Join-Path $to $_.FullName.Substring($from.length)} -PassThru |
                ForEach-Object {$fileCount++}
            Write-Host ("Copied {0} files/folders successfully at {1}" -f $fileCount, $(Get-Date))
    Thanks again
    JonW
    JonW

  • Extracting node value from XPath Expression in OSB Conditional Branch

    HI All
    While using conditional branch in OSB,i only get an XPath Expression editor to set a variable used to test a condition.
    Now let's say my request is
    <Body>
    <exam:PersonSearchReq xmlns:exam="http://www.example.org">
    <exam:RequestorSSO>James</exam:RequestorSSO>
    </exam:PersonSearchReq>
    </Body>
    I write my XPath expression as :
    ./exam:PersonSearchReq/exam:RequestorSSO/text()
    Now if I test this using the tester application , insted of getting node value 'James' ,i get the entire node element ,i.e
    <exam:RequestorSSO xmlns:exam="http://www.example.org">James</exam:RequestorSSO>
    Please suggest how can i extract the text value.
    Regards,
    Chinmay

    Hi Guys
    Actually it turns out that you need to populate In-Variable to function is correctly.As soon as i entere 'body' in it,it worked fine.
    Thanks
    Chinmay

  • Servlet to count the number of occurances of a particular node

    Hi
    I am looking for a servlet which will count the number of a particular node which I have supplied of an XML file.
    Can somebody please help me with this?
    Thankyou

    If you are using Xerces, after you have parsed your XML files using a DOMParser, get the document object from the parser like
    Document document = parser.getDocument();
    And then use the command getElementsByTagName("*"); // for all elements
    it will return the node list object (NodeList) which you can get the count (nodeList.getLength())

  • How do I count the number of occurrences of a string within a group of cells?

    Hello all, I'm trying to figure out how to count the number of times a child has completed certain tasks.  Here is a sample of the data (it is highly simplified here, but contains what I hope is needed to answer my question):
    Unnamed Table
    Objective
    John
    Ann
    Alex
    Dave
    Eric
    20a 20b 20c
    x
    20a 20b 20c
    x
    20a 20b 20c
    x
    x
    19b 20a
          x
           x
    20c 21b 22
         x
    What I am trying to do is count the number of times each child completed each objective - but I can't figure out how to go about splicing up the "objectives" fields for counting while still being able to compare them to whether or not the "child" has 'an x in the box' in that particular row.

    If I read your example correctly, John's counts should be 2 for 20a, 1 for 19b, 20b and 20c, and 0 for any other objectives listed.
    Here's an example that will work for your data set, assuming that any objective ma occur only once in each row of column A of the Main table. I've added an a to objective 22, but I think it is unnecessary, provided there is no objective 122, 221, etc.
    This uses a two step process.
    The table AUX extracts the objectives completed by each student, using the checkboxes in Main. Note that it also adds a space at the beginning and end of each string. This provides an extra character before the first objective code and after the last objective code in that row, used by the wildcard specification in the formula in the Summary table.
    Formula:
    Aux::B2: =IF(OFFSET(Data :: $A$1,ROW()-1,COLUMN()-1)," "&OFFSET(Data :: $A$1,ROW()-1,0)&" ","")
    Fill right to the last column and down to the last row of Aux.
    Summary uses COUNTIF to count the number of occurrences of each of the objectives listed in column A of that table.
    Formula:
    Summary::B2: =COUNTIF(Aux :: B,"=*"&$A2&"*")
    Fill right and down as the previous formula.
    Regards,
    Barry

  • How to count the occurrence of an unbounded segment of an idoc

    idoc ORDERS.ORDERS05 has segment  E1EDP01 which  has an occurrence(0-9999), how can we count the number of times E1EDP01 segment is coming in a particular ORDERS.ORDERS05 idoc

    Hello,
    You can use the pre-defined statistic function called count in your requirement
    E1EDP01 -> removeContext -> count -> targetField
    Hope this helps,
    Mark

  • In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    The query is re-issued as a flashback query and the client process can continue to fetch from the cursor. This is described in the Net Services Administrators Guide, the section on Transparent Application Failover.

  • Showing Duplicate records in a report with the count of their occurrence

    Hi Members,
    I am novice to BI. i need your suggestion to achiever one of the functionality. A report is required to be built with columns Incident ID, Task ID, Task Name. The Original report is below:-
    In the above report I have to display only duplicated records once. Distincat records are not required to be shown. That is, if the same no. of Task Name is associated with the same Incident ID then it should be displayed once with the count of their occurrences in a separate column say , Count. For example, the Task 'TASK_MANUAL_KCI'  got 4 times associated with the same Incident ID INC000000001434. Then the report should display this task one time in a report with count 4. Similarly, for INC000000000943 where task 'IPCG Diagnostic Template' got associated 2 times. The Count is 2 for this task.
    Other records should not be displayed in a report.
    Would highly appreciate quick response. Please suggest.
    Thanks,
    Neha Pateria

    I tried this Gill, but result is bit different :-
    Seems some little modifications are needed. Report should be displayed like the below one where it says how many times the same Task is associated with the same incident. Eg. Task 'TASK_CIRCUIT_RESOLVER' is associated with the incident 'INC000000001434' 4 times. 'IPCG Diagnostic Template' is associated with  'INC000000000943' 2 times. Similarly for other records.
    But I really thankful to you for giving me the logic proceed further. I tried  '=RunningCount([Task Name]; Row; ([Task Name]; [Incident ID]))'. It gave me desired results. :-
    But the only thing that needs to be done is to bring the single Task associated with the Incident..
    Thanks,
    Neha Pateria

  • Count no. of records for a particular customer in the query?

    Hi,
    1)Can anybody guide as to how do we count the number of records for a particular customer. E.g.
    C1 has placed 2 orders
    C2 has placed 4 orders
    C3 has placed 5 orders
    so in all the ODS has 11 records. Now while designing the query we need to ensure that we show only the Customers who have placed more than 3 orders. What could be logic to solve this kind of a problem?
    2) Is there a way that we can access the structure and data of the ODS in ABAP code say one of the includes in a user exit?
    The requirement says there could be N number of cases opened and closed in one month. Now we need to calculate the average number of days taken to close a case? Any ideas on the possible solution.
    Thanks
    RB

    Hi Rajat,
      Take a calculated key figure rename it as Count , go to the properties of that calculated key figure on the left hand side not at the columns side in the properties click on the button Enhance which is shown in the down left side, in the exception aggregation part select "count all values <>0" , take the reference character as customer Id . Now go to the Customer character which is in rows go to properties and select  "Normalise to" combo box  in that select "Query result" now u will get the exact result which ur looking for .

  • Display a particular node of Hierarchy in the Report.

    Hi , all
    I have an urgent requirement that i have to  display only a particular node(5) of Hierarchy in the Bw Report , I have tried different options available in the Hierarchy tab (That is Expand to level 5 , Position of lower node - Above , Value of posted node - Hide ) . But stil it is displaying 5 and then 4 node , but i don't want that 4 node .
    Can anybody gine me some useful suggestion .
    Thanks in advance..

    Hi Akash,
    - To show only particular nodes of a hierarchy in the Excel sheet:
    Step 1: include the base characteristic
    Step 2: select the hierarchy (properties of the characteristic) - (display key only)
    Step 3: user restrict (from context menu of the characteristic) on the nodes that you want to display.
    Step 4: expand to level: 1 (properites of the characteristics)
    This should serve the purpose.  I know it is a little late, but it might be helpful in the future

Maybe you are looking for

  • Korean Language Display Question

    Hi everyone, Here's a curious question I have for anyone else here that can read/write korean. I have this one song by the artist Seven (Se7en) with the english title of the song "Holding Flowers." I have the song title input into Korean characters o

  • How do you adjust the font size for the tabs and icons around the screen?

    How do  you adjust the font size of tabs and and icons to ake them larger?

  • JMS Destination object not found

    Hi everyone, I have a weird problem with SunONE Message Queue 3. I have a queue and a connection factory defined (using the SunONE Application Server 7 Admin Console) as well as a physical resource. I can verify their existance using asadmin.... asad

  • Unable to copy text from PDF in Safari

    Where did the Copy command ability go when viewing a PDF in Safari? In a recent Safari update, the functionality has disaapeared. Prefer not to take the extra step to Save As, then open in Preview or Adobe Reader just to copy a word or line of text.

  • Getting subscription fees from user. Implementing this?

    I'm wondering what options are there and what would be the best option to handle receiving subscription payments from users of a business J2ME app? I would like to have them charged to their phone bill. If the user has been using the app for 6 months