How to Count a Characteristic Occurence?

Morning,
I have Assembly(Material) being displayed as a Row item in my query. My need is to count the number of rows for Assembly in the query. I referred to "How to Count" doc, but that counts every occurence of assembly. Whereas, I need to count an Assembly just once.
Can somebody help me on this?
Thanks.

Vijay,
Here is how it is desired:
Plant   Assembly  Count
7835   711712101    1        
<   >   711712103    1
<   >   711712111    1
<   >   711712401    1
<   >   711713101    1
Can you explain how I can do with this?

Similar Messages

  • How to count a characteristic (Query Design)?

    What is the best way to count a characteristic in a query?  To be more specific, I would like to count the number of orders (characteristic 0COORDER).
    I have read the whitepapers:
    -HowTo Count the occurrences of a characteristic relative to one or more other characteristics
    -HowTo Calculate with Attributes
    I would like to build a query that looks like the following:
    Order Type      # Orders
    A                      3
    B                      5
    C                      4
    In my InfoCube,
    OrderID OrderLineID MaterialID Quantity Price ZCount
    1                             1
    1                             2
    2                             3
    3                             4
    3                             5
    3                             6
    I added a counter to my infoCube which counts the number of line items per order (from HowTo count occurences of characteristic whitepaper).  <b>However, now I need to count the number of orders.</b>
    One approach I tried was to create a dummy calculated keyfigure, which i set to a constant of 1.  I then created another calculated keyfigure and used Count ( dummyKeyFigure).  I could have also achieved the same result by using SUMGT (dummyKeyFIgure).  However, this only works if you have orderID in your query row:
    OrderID      dummyKeyFigure (hidden)         
    1                        1
    2                        1
    3                        1
    Result:                3  (SUMGT of dummyKeyFigure)
    I also read a thread that discussed another alternative on how to use a replacement path variable to count a characteristic (using the key)... however the procedure wasn't clear.  When I tried to create a variable on orderID using a replacement path, it asked for either a variable or query to use... and I got "stuck" from there.  Can you use a replacement variable to count the number or orders? 
    What are the different alternatives (and procedures) for counting the number of orders?
    Thanks,
    -B
    Message was edited by:
            Brendon Lipchen
    Message was edited by:
            Brendon Lipchen

    Hey Olivier.
    I do have Key Figures in my cube.  However, I only want to count the number of Orders in my InfoCube.
    For your solution, you say to create a CKF.  In order to create a CKF, you need a KF to put in your CKF calculation (note you omitted this step from your solution).  There is no KF in the infocube to use for the Order count (we are creating "this" CKF to get the Order Count).  If there is no KF you can use in your InfoCube to get the Order Counter, then you need to create a replacement path variable to use in your CKF calculation.  After you have created a replacement path variable for OrderID, you can place this variable in your CKF calculation (instead of using a KF).  Make sense?

  • Query Designer - how to count distinct  characteristic values in a column

    Hello Experts,
    I need to count the number of distinct occurences in a column and use it later for a percentage calculation. I'll give you a concrete example:
    Promotion_ID   Product    Promoted
    A  ******************  P1 ********  1
    A  ******************  P2 ********  0
    A  ******************  P3 ********  1
    B  ******************  P1 ********  0
    B  ******************  P3 ********  1
    C
    D
    A promotion ID can have more than 1 product associated with it. A product can be promoted (1) or not. A promotion_ID can be also empty (no products C and D)
    I need to calculate for each product the percentage of promotions where the product is promoted out of ALL promotions (4) or
    P1  25 %
    P2  0 %
    P3  50%
    How can I model this in the Query Designer ? How can I count the distinct Promotion_IDs ?
    Any ideas will be appreciated.
    Thanks
    Rado

    Hi,
    Please take a look at the docs below.
    https://websmp102.sap-ag.de/~sapdownload/011000358700002762432003E/HowToCount.pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7e58e690-0201-0010-fd85-a2f29a41c7af
    Regards,
    ®

  • How to count number of occurences of a character  in a string

    I want to get the count of occurences of a character within a string. Is there any function for this or should i go for a PLSQL.
    For example is the sting is "occurences" & if i search for character "c", the answer should be 3.
    Regards,
    Sunil.

    SQL> select length('occurence') - length(replace('occurence','c')) from dual;
    LENGTH('OCCURENCE')-LENGTH(REPLACE('OCCURENCE','C'))
    3

  • How to count number of occurence of a particular charchter

    Hi All,
    Anybody there who can help me in counting the no. of occurence of a particular char in a string, with the help of a select query !!!
    For example : there is a string 'RAJENDRA'. I want the select query to print 2 in this case without using a pl/sql function.
    Thanks & Regards
    --DKar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hi,
    If you are working on 10G you can use below query also.
    SQL> ed
    Wrote file afiedt.buf
      1* SELECT LENGTH(REGEXP_REPLACE('RAJENDRA','+[^R]')) FROM DUAL
    SQL> /
    LENGTH(REGEXP_REPLACE('RAJENDRA','+[^R]'))
                                             2
    SQL>Regards

  • How to count number of repeated characters in a String

    I have a String.... 10022002202222.
    I need to know how many 2's are there in the string... here the string contains eight 2's..
    Thanks in advance..

    it is workingYes, but... attention to surprises...
    SQL> var v1 varchar2(1000);
    SQL> exec :v1 := 'How to count the number of occurences of a characters in a string';
    PL/SQL procedure successfully completed.
    SQL> select length(:v1) - length(replace(:v1,'c')) from dual;
    LENGTH(:V1)-LENGTH(REPLACE(:V1,'C'))
                                       6
    SQL> exec :v1 := 'cccccc';
    PL/SQL procedure successfully completed.
    SQL> select length(:v1) - length(replace(:v1,'c')) from dual;
    LENGTH(:V1)-LENGTH(REPLACE(:V1,'C'))
    SQL> select length(:v1) - nvl(length(replace(:v1,'c')),0) from dual;
    LENGTH(:V1)-NVL(LENGTH(REPLACE(:V1,'C')),0)
                                              6
    SQL>

  • How to count Unique Values in BEx

    Hi Guys,
    Can anybody please let me know how to count unique values of a characteristic.
    Thanx in advance
    Peter

    I have a similar scenario. If i drill up on the characterstic that had a count of one in each record, the total number of records should be stay equal to the summarised results in the last screen.
    Would someone know how to do that .
    Arti

  • Counting the Multiple Occurence of a record in the internal Table-Urgent

    Hi,
    I have an internal table with the following values
    a
    a
    a
    b
    b
    b
    c
    c
    I need to print a-2
                         b-3
                         c-2
    How do i accomplish this? i.e.,I need to count the multiple occurence of a field.Any input on this will be of great help.
    Thanks and Regards,
    Pavithra

    Hi,
    Find the piece of code below it can help you:
    data: begin of itab occurs 0,
               field1 type c,
               field2 type i,
            end of itab.
    data: itab2 like table of itab occurs 0 with header line.
    data: count type i.
    start-of-seleciton.
    itab-field1 = a.
    append itab.
    itab-field1 = a.
    append itab.
    itab-field1 = a.
    append itab.
    itab-field1 = b.
    append itab.
    sort itab by field1.
    loop at itab.
      count = count + 1.
    at end of field1.
      clear itab2.
      itab2-field1 = itab-field1.
      itab2-field2 = count.
      append itab2.
    endat.
    endloop.
    Dispaly output table.
    loop at itab2.
      write:/ itab2-field1, itab2-field2.
    endloop.
    Reward the points if it is helpful.

  • 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 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

  • How to count number of related radibuttons in the doccument?

    The field "radiobutton" can have several related radiobuttons.
    How to count quantity of radibuttons with the same name in the doccument?

    With
    this.getField("radiobutton.0");
    this.getField("radiobutton.1");
    and so on you can access the different instances.

  • How to Count number of rows

    Hi All
    If I have 2 tables with records in it, with primary Table A and Foreign key Table B structure.Then how to count the no of occurances of each records of table A in table B and print the values.
    Thanx

    Hi,
    If I understood you can a query like this:
    SGMS@ORACLE10> create table a (cod number);
    Table created.
    SGMS@ORACLE10> create table b (cod number,id number);
    Table created.
    SGMS@ORACLE10> alter table a add constraint pk_a primary key (cod);
    Table altered.
    SGMS@ORACLE10> alter table b add constraint fk_b_a foreign key (cod) references a;
    Table altered.
    SGMS@ORACLE10> insert into a values (1);
    1 row created.
    SGMS@ORACLE10> insert into a values (2);
    1 row created.
    SGMS@ORACLE10> insert into a values (3);
    1 row created.
    SGMS@ORACLE10> insert into b values (1,1);
    1 row created.
    SGMS@ORACLE10> insert into b values (1,2);
    1 row created.
    SGMS@ORACLE10> insert into b values (1,3);
    1 row created.
    SGMS@ORACLE10> insert into b values (2,1);
    1 row created.
    SGMS@ORACLE10> insert into b values (3,1);
    1 row created.
    SGMS@ORACLE10> insert into b values (3,2);
    1 row created.
    SGMS@ORACLE10> commit;
    SGMS@ORACLE10> select b.cod,count(*) from b,a where a.cod = b.cod group by b.cod;
           COD   COUNT(*)
             1          3
             2          1
             3          2
    SGMS@ORACLE10>Cheers

  • How to count Number of  completed instances

    Hi all,
    I have one issue regarding *"How to Count Completed instances"* in SOA...
    How can i count the number of completed instances for a interface...Any idea or suggestion plzzzzzz....
    Thanks,
    Raj

    Hi Dariel Pérez ,
    By executing the Querey I'm able to get the State and num_cube instances but when I call this Query in BPEL by using DB adapter I get the following error
    BINDING.JCA-12563 Exception occured when binding was invoked. Exception occured during invocation of JCA binding: “JCA Binding execute of Reference operation ‘CountReq’ failed due to: Pure SQL Exception. Pure SQL Execute of SELECT (CASE WHEN STATE=1 THEN ‘OPEN AND RUNNING’ WHEN STATE=2 THEN ‘OPEN AND SUSPENDED’ WHEN STATE=3 THEN ‘OPEN AND FAULTED’ WHEN STATE=4 THEN ‘CLOSED AND PENDING’ WHEN STATE=5 THEN ‘CLOSED AND COMPLETED’ WHEN STATE=6 THEN ‘CLOSED AND FAUTED’ WHEN STATE=7 THEN ‘CLOSED AND CANCELLED’ WHEN STATE=8 THEN ‘CLOSED AND ABORTED’ WHEN STATE=9 THEN ‘CLOSED AND STALE’ WHEN STATE=10 THEN ‘NON-RECOVERABLE’ ELSE STATE || ” END) AS STATE, COUNT(*) AS NUM_OF_CUBE_INST FROM CUBE_INSTANCE GROUP BY STATE; failed. Caused by java.sql.SQLSyntaxErrorException: ORA-00911: invalid character . The Pure SQL option is for border use cases only and provides simple yet minimal functionality. Possibly try the “Perform an operation on a table” option instead. This exception is considered not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCodes with value “-911″ to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers. “. The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    Any Suggetions.
    Thanks
    Mani

  • How to count number of autoextents that had took place between a period.

    urgent question
    Hi all
    how to provide me a report for getting the result of the Disk Drive Space usage (drive letter) that shows how quickly the space is being used up by the database(dbf files).
    Or how to count the number of autoextents that had took place between a certain period of time.
    either by cmd promt or OEM would be fine
    Oracle database 10g(single instance)
    OS:Windows 2003 server
    thanks
    Anto

    hi justin and Pavan
    First Thanks for your immediate responce,
    Secoundly client has asked for the growth report at the OS level and not at the database level. but the growth is with respect to the autoextent feature that oracle has over the datafiles.
    I was thinking that i could get a view or some history log to get this data retrieved from the past may be of a months data.I normally manually check the data base growth with the following script
    SELECT total_space,free_space,
    (NVL(total_space,2)-NVL(free_space,2) ) used_space
    FROM (select round(SUM(Bytes/1024/1024/1024),2) Total_space
    from DBA_data_files
    (select round(SUM(Bytes/1024/1024/1024),2) free_space
    from DBA_free_space
    but this is Oracle DB level.
    Any ideas for the report.like a query or somewhere in OEM
    Thanks
    Anto

  • How to count number of lines in a file?

    I am using a BufferedReader to read my file, but I like to know how to count the number of lines in a file is there a way to do that in Buffered Reader or do I have to use FileInputLineStream?

    Well, if you know how to read one line with a Buffered reader, and you know how to keep reading lines until you run out, then all you have to to is initialize a counter to zero before you start reading, add 1 to it each time you read a line, and then examine its value when you're done.
    Try that, and post again if you get stuck.
    Just be careful how you construct your loop. "Off by one" errors are a common way to get bitten. It could happen if you count what you think is the last line, but you've actually already counted all the lines and you end up counting one extra for "there are no more lines".

Maybe you are looking for

  • Error in g/l account creation

    Hi all, While i'm creating g/l account centrally system asking group account number in type/description data tab, where can i maintain group account number? and without giving this i unable to create g/l accounts. If i'm giving any value in this fiel

  • Printer works on every program except trying to print anything from Firefox. Blank pages everytime.

    Using Windows XPproffesional & current Firefox 4.0.1. Printer works on every program except anything from Firefox,.blank page every time. When I hit File>Print; the "Print Frames" section in lower left hand box has no options checked and is unaccessi

  • Unable to print to pdf from a pdf

    We're having a issue where we're unable to print to pdf from a pdf with acrobat 9 std, so far a 64bit machine. We get the following errors "the document could not be printed" "there were no pages selected to print" We see the issue with all pdfs. Acr

  • Two masters and one detail block

    Hello All, I have three tables Person_master, Addr_master, person_address_link. Person_master - Person_id number (8), fname, lname and other fields, Addr-master - Address_id number(9), addr_1, addr_2 and other fields Person_address_link Person_id, Ad

  • URL iView - ERROR Invalid URL parameter - sap-ext-sid - HTTPS link

    Dear Experts, I have an uregent issue. I have configured an url iview, the link is HTTPS. it is not working from the portal. the system automatically concatenates some URL parameters like sap-ext-sid , sap-wd-finish-rendering. Similar way i have conf