Count or "distinct count" number of items in SAP BI 3.5

Hi all,
I have a requirement that goes like this:
In an ODS-object there are two characterisitics among others. Against each client there are several numbers of articles.
01. I have to count the number of articles against each client.
02. I have to count the number of distinct articles over all clients.
Do you think there's a chance to solve BOTH requirements in Query Desinger only? I actually do NOT want to modify the respective ODS or MultiProvider configurations.
Client --- Article --- Nr. of entries
301 --- A1000 --- 50
301 --- A2000 --- 100
301 --- A3000 --- 50
302 --- A1500 --- 50
302 --- A2500 --- 100
302 --- A3000 --- 50
303 --- A2000 --- 10
303 --- A3000 --- 50
Following is a sample how the results should look like:
Task "1":
Client --- Nr. of different articles
301 --- 3
302 --- 2
303 --- 2
Task "2":
Nr. of different articles over all clients
5
Any pointers about this are most welcome.
Kind regards,
Thorsten.

Hi,
I'm not sure the count function works in 3.5 since you can't set the proper aggregation setting. You can try the following however:
Create a new calculated key figure
In this, create a new formula variable
Set the formula variable to replacement path
Choose the infoObject you want to count as replacement object
Set the replace by to attribute value
Choose attribute reference, (constant 1)
Use the formula variable in your calculated key figure.
Hope it helps.
Kind regards,
Alex

Similar Messages

  • How to count number of items present in a data block

    hi all,
    how to count how many items present in a particular data block in oracle forms 10g.
    whether it is a text_item or display_item or list_item etc is there any method to do this.
    please reply....

    hi all,
    i have written this when-button pressed but the problem is how to get the next item name in the block
    DECLARE
         V_COUNT NUMBER:=0;
         V_FIRSTITEM VARCHAR2(100):='';
    BEGIN
         GO_BLOCK('BLOCK_ITEMCOUNT');
         V_FIRSTITEM := GET_BLOCK_PROPERTY('BLOCK_ITEMCOUNT', FIRST_ITEM);
         LOOP
              V_COUNT := V_COUNT + 1;
              EXIT WHEN GET_ITEM_PROPERTY(V_FIRSTITEM, NEXTITEM) IS NULL;
              --V_FIRSTITEM := GET_BLOCK_PROPERTY('BLOCK_ITEMCOUNT', NEXTITEM);
              --V_COUNT := V_COUNT + 1;
         END LOOP;
    END;

  • How count number of item records in a File: Idoc to File scenario

    Hi All,
    I am configuring an IDOC to File scenario.
    Once all the IDOC data is dumped on a File, I need to calculate the number of Item records in this file and write this number at the end of the trailer record in the file.
    Is theer a way to calculate the item data records(or say number of lines in the file) in the message mapping area. Or any other simple way to do it.
    Appreciate your help on same.
    Thanks
    Shirin

    hi,
    Use the count function for ITEM node the assign this count value to the receiver field , keep the ITEM context to header!
    Thanks,
    Vijaya.

  • How to Count Number of completed line items in past 6 months / 12 months ?

    How to Count Number of completed line items in past 6 months / 12 months ?
    Hi,
    I am trying to count "Number of Completed Line Items in Purchase Order Document" for my Key Figure ZPO_CNT.
    Purchase Order document = ZEBELN
    Line Item = ZEBELP.
    I need to find and count if the Line Item has been received in the past 6 months from today and similarly in the past 12 months.
    I have "Delivery Completed" field, ELIKZ.
    So, based on this would I be able to calculate it in Query Designer?
    If so, Please let me know how

    Hello Deva
    If youe want to calculate the completed line item for last 6 or 12 month then i think u will be displaying the query data for these montrhs...create a customer exit to give you date range and restric it in filter area....
    Now Choose any of the below option
    1. I would suggest to implement an additional key figure "counter" in cube and fill values with one for which delivery is completed.
    Now use calculated key figure in Query Designer based on logic
    IF counter = 1 THEN counter ELSE 0
    OR
    2. create a formula variable based on ELIKZ and use replacement path variable, it will display you no. of docs for which delivery is completed....
    Award points if it solves your problem
    Revert back in case of further assistance...
    Thanks
    Tripple k

  • Powershell script to count number of list and library items in site collection

    We are identifying large lists in our 2010 SP environment and I'm attempting to write code to output the total number of list items in a site collection.   I'm using the code below but it only displays column data for title and url. 
    What do I need to add so it can count the number of items in each sharepoint list and library? 
    Get-SPSite -WebApplication http://sharepoint -Limit All |
       Select -ExpandProperty AllWebs |
       Select -ExpandProperty Lists |
       Select ParentWebUrl, Title
    I'm referencing
    http://sharepointpromag.com/sharepoint/windows-powershell-scripts-sharepoint-info-files-pagesweb-parts

    Please find belwo script, it will iterarte through all the folder/Subfoder to get the item counts from all list and library, you can modify this script to run this at site collection scope:
    Note: save the script in .ps1 file and execute the script as described below to get log file, it will save the log file out.txt in seleted directory:
    e.g.PS D:\PowershellScripts> .\ListItemCount.ps1 > out.txt
    $SPWebApp = Get-SPWebApplication "http://weburl.com/"
    foreach ($SPSite in $SPWebApp.Sites)
    if ($SPSite -ne $null)
    foreach ($SPWeb in $SPSite.AllWebs)
    foreach ($list in $SPWeb.Lists)
    $ListURL = $SPWeb.url + "/" + $list.RootFolder.Url
    Write-Output $ListURL
    [Microsoft.SharePoint.SPQuery]$query = New-Object Microsoft.SharePoint.SPQuery
    #$query.Folder = fldr;
    #Recursive Scope....
    $query.ViewAttributes = "Scope='Recursive'"
    $allitems = $list.GetItems($query);
    $filecount = $allitems.Count;
    Write-Output " No of item: " $filecount
    if ($SPWeb -ne $null)
    $SPWeb.Dispose()
    if ($SPSite -ne $null)
    $SPSite.Dispose()
    You can update the code to get any specific list type item count, using if($list.BaseType -eq "DocumentLibrary") condition:
    if($list.BaseType -eq "DocumentLibrary")
    $ListURL = $SPWeb.url + "/" + $list.RootFolder.Url
    Write-Output $ListURL
    [Microsoft.SharePoint.SPQuery]$query = New-Object Microsoft.SharePoint.SPQuery
    #$query.Folder = fldr;
    #Recursive Scope....
    $query.ViewAttributes = "Scope='Recursive'"
    $allitems = $list.GetItems($query);
    $filecount = $allitems.Count;
    Write-Output " No of item: " $filecount
    if ($SPWeb -ne $null)
    $SPWeb.Dispose()
    If my contribution helps you, please click Mark As Answer on that post and Vote as Helpful
    Thanks, ShankarSingh

  • Please let me know how to Count Number of completed line items in past 6 mo

    How to Count Number of completed line items in past 6 months / 12 months ?
    Hi,
    I am trying to count "Number of Completed Line Items in Purchase Order Document" for my Key Figure ZPO_CNT.
    Purchase Order document = ZEBELN
    Line Item = ZEBELP.
    I need to find and count if the Line Item has been received in the past 6 months from today and similarly in the past 12 months.
    I have "Delivery Completed" field, ELIKZ.
    So, based on this would I be able to calculate it in Query Designer?
    If so, Please let me know how
    Krishna

    Hi Experts,
    I dont have a defined Restricted key figure yet.
    I have populated 0COMPL_DEL(Delivery Completed Indicator)  and 0EBELN (Purchasing Document Number) and 0EBELP (Line Item Number in Purchasing Document) .
    This is what I think how I need to calculate:
    Number of completed line items in past 6 months:
    If  Delilvery Completed Indicator (0COMPL_DEL) = x, calculate No. of Line Items (ZPO_CNT) from 0CALDAY to 6 months
    and
    Number of completed line items in past 12 months:
    If  Delilvery Completed Indicator (0COMPL_DEL) = x, calculate No. of Line Items (ZPO_CNT) from 0CALDAY to 12 months
    Please let me know if the logic is correct. If so, how I can create this in report

  • Use Windows PowerShell to count and list total number of items in Folders E-Mail in Office Outlook?

    I have the need to generate a list of all outlook folders and the total number of items listed beside each folder name. I thought I could simply modify the script from " http://blogs.technet.com/b/heyscriptingguy/archive/2009/01/26/how-do-i-use-windows-powershell-to-work-with-junk-e-mail-in-office-outlook.aspx
    " regarding the total number of items in the junk folder but no luck.
    I thought I could just simply duplicate line 6 of the aforementioned script
    "$folder = $namespace.getDefaultFolder($olFolders::olFolderJunk) " and change the folder name but getting the "Method invocation failed because [Microsoft.Office.Interop.Outlook.OlDefaultFolders] does not contain a method
    named 'olFolder'.
    At line:7 char:1
    + $folder = $namespace.getCurrentFolder($olFolders::olFolder("Design Engineering S ...
    I've found a way to export a list of all these folders using exportoutlookfolders.vbs to a txt file but doesn't include total number of items.
    Looking for any pointers on how to make this work. Don't expect anyone to write it for me but I am still learning PS. Would be great to find a way to import all of these folder and subfolder names into the script. Will be appreciative of any advice though.
    There's an enormous amount of Outlook folders.
    Outlook 2013
    Windows 8
    Thanks,
    Barry

    Since I am not and administrator, but an end user, I do not have access to the Get-Mailxxxx commandlets to make this really easy and had to do this long hand.
      The following will pull folder.name, folder.items.count, and sum the total size of each folder's items for all folders and their subs. 
    Just one warning, the summation can take some time with a large PST file since it needs to read every email in the PST. 
    There is also some minor formatting added to make the results a little more readable.
    $o
    = new-object
    -comobject outlook.application 
    $n
    = $o.GetNamespace("MAPI") 
    $f
    = $n.GetDefaultFolder(6).Parent 
    $i
    = 0
    $folder
    = $f
    # Create a function that can be used and then re used to find your folders
    Function
    Get-Folders()
    {Param($folder)
     foreach($folder
    in $folder.Folders)   
    {$Size =
    0
    $Itemcount
    = 0
    $foldername
    = $folder.name
    #Pull the number of items in the folder
    $folderItemCount
    = $folder.items.count
    #Sum the item (email) sizes up to give the total size of the folder
    foreach ($item
    in $folder.Items)
    {$Itemcount
    = $Itemcount
    + 1
    $Size =
    $Size +
    $item.size
    Write-Progress -Activity ("Toting size of "
    + $foldername
    + " folder.")
    -Status ("Totaling size of "
    + $Itemcount
    + " of "
    + $folderItemCount
    + " emails.")
    -PercentComplete ($itemcount/$folderItemCount*100)
    # just a little formating of the folder name for ease of display
    While($foldername.length
    -le 19){$foldername
    = $foldername
    + " "}
    #Write the results to the window
    Write-Host ("-folder "
    + $foldername
    + "  
    -itemcount " +
    "{0,7:N0}" -f
    $folderItemCount +
    "   -size " +
    "{0,8:N0}" -f ($size/1024)
    + " KB")
    #If the folder has a sub folder then loop threw the Get-Folders function.
    #This two lines of code is what allows you to find all sub folders, and
    #sub sub folders, and sub sub sub for as many times as is needed.
    If($folder.folders.count
    -gt 0)
    {Get-Folders($folder)}
    get-folders($folder)

  • How to count number of xml nodes , with JSTL XML api?

    I am trying to count the number of nodes in the parsed xml by doing this:
    <x:out select="count($doc/Items/Item)"/>
    There are about 50 item nodes in the source xml, but I get the output as 0
    Is this syntax correct?
    I searched every where but couldn't find the xpath syntax to be used inside jstl xml tags, I was assuming that it's the same as the syntax used in xslt

    Thank you for your reply, sorry I wasnt very clear with my question.
    I want to count the number of nodes inside the jsp file , not inside the xslt file.
    My xml file is something like this for example:
    <?xml version="1.0" encoding="UTF-8"?>
    <DocumentRootNode>
    <Products>
    <Item>1</Item>
    <Item>2</Item>
    <Item>3</Item>
    <Products>
    </DocumentRootNode>
    I want the count of number of Item nodes , in the JSP file.
    I'm doing something like this in the JSP but it gives 0 instead of 3:
    <c:import url="source.xml" var="xml" charEncoding="UTF-8"/>
    <x:parse doc="${xml}" var="xml_doc"/>
    <x:out select="count($xml_doc/Products/Item)"/>
    null

  • Count Selected Shuttle Items

    Apex 3.2
    I have a shuttle item and a text box.
    As the user moves items from the left of the shuttle to the right, I would like to display a count (in the text box) of the number
    of items he has chosen.
    I know that his will probably have to be done with an onclick javascript function, but I have no idea how to do it.
    I cannot use dynamic actions, as this is an Apex 3.2 application.
    Please have a look at my workspace
    Workspace: GUSCRIGHTON
    Username: [email protected]
    Password: terminator
    App Id: 25851
    Page: 5
    Thanks
    Gus

    I was kind of hoping to capture the change event on the shuttle fieldset, but can't, for some reason. I'm too rusty in my js-fu. If that'd even work in 3.2, no clue.
    Binding to the controls like Jari suggested works though.
    function setShuttleSelectedAmount(pShuttleId, pAmount){
      var lAmount = document.getElementById(pShuttleId+"_RIGHT").children.length;
      document.getElementById("P5_DESCRIPTION").value = lAmount;
    function attachShuttleEvents(pShuttleId){
      document.getElementById(pShuttleId+"_RESET").addEventListener("click", function(){
        setShuttleSelectedAmount(pShuttleId);
      }, false);
      document.getElementById(pShuttleId+"_MOVE").addEventListener("click", function(){
        setShuttleSelectedAmount(pShuttleId);
      }, false);
      document.getElementById(pShuttleId+"_MOVE_ALL").addEventListener("click", function(){
        setShuttleSelectedAmount(pShuttleId);
      }, false);
      document.getElementById(pShuttleId+"_REMOVE").addEventListener("click", function(){
        setShuttleSelectedAmount(pShuttleId);
      }, false);
      document.getElementById(pShuttleId+"_REMOVE_ALL").addEventListener("click", function(){
        setShuttleSelectedAmount(pShuttleId);
      }, false);
      document.getElementById(pShuttleId+"_LEFT").addEventListener("dblclick", function(){
        setShuttleSelectedAmount(pShuttleId);
      }, false);
      document.getElementById(pShuttleId+"_RIGHT").addEventListener("dblclick", function(){
        setShuttleSelectedAmount(pShuttleId);
      }, false);
    attachShuttleEvents("P5_SHUTTLE");
    PS: I also want to mention that this may be browser dependant, especially for IE<9 where you would need to use attachEvent instead of addEventListener...
    Edit: maybe Paul knows more!

  • Counting number of records in a data block

    hi folks,
    Simple question for you guys: How can I count number of records in a data block.
    In other words, say I have 10 detail records listed on a data block (one of my columns is a non-database item for entering a number). Now I just want to do somethin like:
    Select count(*) From <data_block> into lnRecCount
    Where <non-database column> <> 0 ;
    Can I do this in a button trigger? I can't get it to work?
    Thanks,
    bob

    You should make a routine that go through records of the block and count the records that agree with your condition.

  • Count number of lines

    hi
    is there any method which counts number of the lines in a file?

    Grrrr @ stoopid requirements.
    OK, I'd create an array of some default size (not too large, not too small). Read from file and add to array. If it becomes full, create a new array of some default size bigger and copy all values in original array to new array (you can use System.arraycopy). Also keep a counter that keeps track of how many items have been read/added.

  • Auto Counting Number of Rows Where Data is Entered

    I am trying to automatically count the number of rows where data is entered.  For example, I have a table with six open rows to enter information.  If only three of those rows (A2-A4) had names entered in them, and the next three rows were left blank, can I get each name to equal the value "1" so that I can get a total tally of how many names have been entered? So the final tally in this example would be "3." I appreciate your help!
    file:///Users/josephdlugo/Desktop/Screen%20Shot%202014-04-30%20at%2011.58.28%20A M.png

    there is a function, COUNTA(), that will count the number of items that are not empty:
    C1=COUNTA(B)
    this is shorthand for select cell C1, then type, or copy and paste the formula:
    =COUNTA(B)
    The COUNTA function returns the number of its arguments that are not empty.
    COUNTA(value, value…)
    value: Any value or a collectioncontaining any values.
    value…: Optionally include one or more additional values or collections.

  • How to count number of sales orders generated in a month in SAP SD

    Hi SD Gurus,
    I have a very strange query from client. I have to count the number of sales order created in a month for a z report. For example 30 in Jan, 25 in Feb etc. Could anyone suggest me How to count number of sales orders generated in a month in SAP SD.
    Regards
    Vinod Kumar

    Hi,
    Goto the T.Code "SE16" or "SE16n" or "SE11".
    Enter the table name as VBAK
    Enter the created on date as the starting date of the period and to date as the end date.
    Enter.
    Click on "Number of Entries".It will tell you the number of entries created in a particular period.
    If you want a report,goto the T.Code "VA05n".
    Regards,
    Krishna.

  • How to Count number of words in a file....

    Hi Experts,
    I have uploaded the text file, from the application server, like this: 
    call function 'GUI_UPLOAD'
      exporting
        filename = LV_ip_FILENAME
      tables
        data_tab = LT_FILETABLE.
    The text file contains some number character words....  like "sap labs india..... "
    Now, I wanted to count number of words in an internal table  LT_FILETABLE....  can anybody help me?

    Hi,
    Special Characters in Regular Expressions
    The following tables summarize the special characters in regular expressions:
    Escape character
    Special character Meaning
    Escape character for special characters
    Special character for single character strings
    Special character Meaning
    . Placeholder for any single character
    C Placeholder for any single character
    d Placeholder for any single digit
    D Placeholder for any character other than a digit
    l Placeholder for any lower-case letter
    L Placeholder for any character other than a lower-case letter
    s Placeholder for a blank character
    S Placeholder for any character other than a blank character
    u Placeholder for any upper-case letter
    U Placeholder for any character other than an upper-case letter
    w Placeholder for any alphanumeric character including _
    W Placeholder for any non-alphanumeric character except for _
    [ ] Definition of a value set for single characters
    [^ ] Negation of a value set for single characters
    [ - ] Definition of a range in a value set for single characters
    [ [:alnum:] ] Description of all alphanumeric characters in a value set
    [ [:alpha:] ] Description of all letters in a value set
    [ [:blank:] ] Description for blank characters and horizontal tabulators in a value set
    [ [:cntrl:] ] Description of all control characters in a value set
    [ [:digit:] ] Description of all digits in a value set
    [ [:graph:] ] Description of all graphic special characters in a value set
    [ [:lower:] ] Description of all lower-case letters in a value set
    [ [:print:] ] Description of all displayable characters in a value set
    [ [:punct:] ] Description of all punctuation characters in a value set
    [ [:space:] ] Description of all blank characters, tabulators, and carriage feeds in a value set
    [ [:unicode:] ] Description of all Unicode characters in a value set with a code larger than 255
    [ [:upper:] ] Description of all upper-case letters in a value set
    [ [:word:] ] Description of all alphanumeric characters in a value set, including _
    [ [:xdigit:] ] Description of all hexadecimal digits in a value set
    a f
          v Diverse platform-specific control characters
    [..] Reserved for later enhancements
    [==] Reserved for later enhancements
    u2192 More
    Special characters for character string patterns
    Special character Meaning
    Concatenation of n single characters
    {n,m} Concatenation of at least n and a maximum of m single characters
    {n,m}? Reserved for later enhancements
    ? One or no single characters
    Concatenation of any number of single characters including 'no characters'
    *? Reserved for later enhancements
    + Concatenation of any number of single characters excluding 'no characters'
    +? Reserved for later enhancements
    | Linking of two alternative expressions
    ( ) Definition of subgroups with registration
    (?: ) Definition of subgroups without registration
    1, 2, 3 ... Placeholder for the register of subgroups
    Q ... E Definition of a string of literal characters
    (? ... ) Reserved for later enhancements
    for more details please refer the following,
    [http://help.sap.com/abapdocu_70/en/ABENREGEX_SYNTAX_SIGNS.htm]
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/902ce392-dfce-2d10-4ba9-b4f777843182?QuickLink=index&overridelayout=true]
    Thanks,
    Renuka S.

  • How to count number of edges using PXIe-6363 Counters

    Hello,
    I am trying to count number of edges in a test signal in a 50 ms duration. I am using PXIe-6363 card and connecting the test signal to CTR 0 SRC (PFI 8). Is it a correct connection? What else do I need hardware-wise to make a correct set up for this application?
    Thanks
    Jeet
    Solved!
    Go to Solution.

    Hi Jeet,
    When you say interrupt signal, do you mean a pulse that will pause your counter task? If that is the case, and you want to pause your task with a digital pulse, you need to use the DAQmx Trigger Property Node and set that to Pause, Trigger Type. As you said, you can connect that signal coming from the chip to any PFI line and then set that line as the source of the property node.
    There is an example that you can use that does exactly what I just described. This example is called Count Digital Events-Pause Trig.vi, and you can find it by going to Help>Find Examples..., then on the NI Example Finder window go to the Browse tab and navigate in the folders to Hardware Input and Outpout\DAQmx\Counter Measurements\Count Digital Events.
    Regards.
    Jorge
    Applications Engineer
    National Instruments
    Certified LabVIEW Associate Developer (CLAD)

Maybe you are looking for

  • Where is the activity function gone? in version 6 Safari

    Where is the activity function gone? in version 6 Safari. I may have updated from a previous version around the beginning of August 2012. I came to use this function only to find it missing??

  • Compare iMovie08 Video Capture/Categorizing to FootTrack and iDive

    Can anyone compare the iMovie08 video capture and categorizing capabilities to FootTrack and iDive?

  • Re: Unable to Run forms in Web Environment....

    Hi Everybody, My current environment: 1. Windows NT Server 4.0 (Service Pack 3) 2. Oracle8 V8.0.4 3. Oracle Web App Server 4.0.5 CR 4. Oracle Developer 6.0 All of the above have been installed on the same machine. Developer 6.0 has been installed on

  • SETTING UP APPROVAL LIMITS IN AR IN VISION OPERATIONS

    Whilst in the AR Corporate Super User responsibility in Vision Operations, I defined approval limits for a an application user with a currency of GBP and an amount ranging from £5000 to£6000 and then saved it. Later, I then decided that I wanted to c

  • Problem in Creating screen in webdynpro

    Hi, Iam creating the first screen thorugh webdynpro. Ive created the view..in the view level, iam not getting the Favorties.. to get the ·    Label for the input field ·        Input field ·        Button (for Submit) we r using Ecc 6.0 can any one p