Count first two columns

Hello,
I have a count requirement that i havent been able to solve by searching sdn.  Maybe someone can help.
I have a query built on a multiprovider that points to two basic cubes.  The basic cubes do not contain a count key figure.  The first two columns of my query are characteristics.  My requirement is to count the occurences of the combination of the first two column (characteristics).  I am looking for a way to do this in the query so i do not have to reload the cubes as they have large volumes of data.  All the suggestions i have been able to find on sdn seem to be only for counting a single characteristic.  Is there a way to count the combination of two?
Regards,
TMS

Hi Create a count using the formula or calculated ket figure for the count unique id like client id for your infocube.
so you will have a count for each row now. place this count object in your column.
now select the two char or the group whatever you want a count in your row.
select query properties and select the display tab and make sure the option - hide repeated key values is selected (normally by default it is selected). Then select each of the char in rows and in free char and set the option under display tab result rows - always suppress.
Execute the query now. you will get the list of char and their count. sort the count by descending to get the most duplicate entries by their highest number on top in the count coulmn.
you can also ignore the rows which donot have a duplicate i.e count more than 1 by creating a new condintion on the count key figure > 1 and restricting the condition  by only the group of char you have given in the column. so that you can also do a drill down by free char in your query and it will only show the duplicates group.
Hope it helps.
regards,
Siva

Similar Messages

  • Export option in ALV report downloades first two columns blank

    Hi ,
    Before posting this query I searched the solution in SDN but I did't find the solution.
    My problem is  After displaying report in ALV format ,if I press Export --> Local file --->spreadsheet ;  file will downloaded to excel sheet but first two columns(only heading no data ) will be blank  and next two columns with proper data.
    I checked field catalog defination it seems to be ok,  any other mistake ?
    Please suggest.
    Narayan

    Hi
    It's the option you have in the path System->List->Save->Local file
    I means it's the standard option to export an abap list into a local file, so you should try this path too and check if the resul it's the same
    I think you should choose  Export --->spreadsheet: here before saving the file an excel document will be open
    Max

  • When I convert my file to excel it cuts off the first two columns, is there a way to fix that??

    When I convert my file to excel it cuts off the first two columns, is there a way to fix that??

    Hey Diann,
    Please let me know whether you are using Adobe Reader or signed up at "https://cloud.acrobat.com/"
    If you are using Adobe Reader, then try converting the file online and vice-versa.
    Let me know.
    Regards,
    Anubha

  • Validating the first two columns of a excel file when importing?

    Hi everyone,
    I have an excel file in the presentation server which has to be uploaded into prog.First the user adds a additonal column in the excel file.
    For example the excel file is intially in this way,
    col1 col2 col3 col4 col5
    Now the user adds one more column 'colx' in the excel sheet and he will upload it into the prog.Before uploading programatically we have to validate that the first two columns of the excel file should be col1 colx(the newly added one).How can I do it?
    Any suggestions please?
    Thank you.

    Hi gopi,
    Thanks for the reply.
    I have one more problem.Now in the excel file I may have only 5 columns in the future it may have more than that.So the internal table which will hold the uploaded values from excel file should be dynamic.I can't declare the internal table with 5 or 6 columns like that.If the user adds some columns in the excel file and upload it,the internal table should hold these columns also.
    i hope u understood my requirement.Can u give me any ideas.If u have any sample code for this kind of requirement.
    Thank you.

  • How to keep first two columns constant

    Hi
    IF i move the scroll bar till end i should get first two Columns constant....
    I mean i want to set Freez to First two columns in my report
    how to du this?
    Regards
    Smith

    HI
    Can you try below for your firtst column while filling the field catalog.
    wa_fieldcat_alv-fix_column = 'X'.
    it works.
    Thanks!

  • Distinct count of values which are displayed in two columns in SSAS

    Hi,
    How is it possible to get distinct count of two columns in fact table, meaning how many different appearances are in both columns.
    Please note I DO NOT mean distinct count on the concatenated fields.
    I’ll demonstrate with example:
    Fact table- deals with CustomerID and SupplierID and deals data.
    I need distinct count of companies which are either customer/ supplier in the fact table.
    (making a concatenated field and distinct count on that would not give what I need).
    Ex: fact :
    Deal1, Customer X, Supplier Y …
    Deal2, Customer X, Supplier Z …
    Distinct count of companies in the above should be 3.
    How can this be done?
    Thanks
    Namnami
    Anyone?? There must be a way to do this?!

    Are you trying to do this using the SSAS model, or just off the data using SQL?  If you were to just use SQL I would create two sub queries and union them to remove duplicates.
    ie.
    SELECT DISTINCT customer FROM table_1
    UNION
    SELECT DISTINCT supplier FROM table_1
    This will give you one unique master list.

  • Update column based on two columns

    Hi,
    MinValue     MaxValue    Desc
    -1                -1    
    -1                 1    
    -1                 2    
    0                  0    
    0                  1    
    0                  2 
    The above is my table which is having three columns MinValue, MaxValue, Desc. First two columns have data and I need to update the 3rd column 'Desc' based on two columns data.
    I need to update like,
    when MinValue=-1 and MaxValue=-1 then 'NotSpecified'
    when MinValue=-1 and MaxValue=1 then 'Up to 1'
    when MinValue=-1 and MaxValue=2 then 'Upto 2'
    when MinValue=0 and MaxValue=1 then 'At lest 1'
    when MinValue=0 and MaxValue=2 then 'At least 2'
    when MinValue=0 and MaxValue=3 then 'At least 3'
    The data in 'MaxValue' is like 1,2,3,4,5...50. So for each description it should append this value as mentioned above(till 'Up to 50', 'At least 50'). How can I do this with case statement?
    Thanks,
    Gangadhar

    declare @T table ( MinValue int,MaxValue int, [Desc] nvarchar(100) );
    insert @T ( MinValue, MaxValue )
    values ( -1, 1 ) , ( -1, 1 ) , ( -1, 2), ( 0, 0), ( 0, 1), ( 0, 2)
    select *
    from @T
    update @T
    set [Desc] = case
    when MinValue=-1 and MaxValue=-1 then 'NotSpecified'
    when MinValue=-1 and MaxValue=1 then 'Up to 1'
    when MinValue=-1 and MaxValue=2 then 'Upto 2'
    when MinValue=0 and MaxValue=1 then 'At lest 1'
    when MinValue=0 and MaxValue=2 then 'At least 2'
    when MinValue=0 and MaxValue=3 then 'At least 3'
    end
    select *
    from @T
    T-SQL Articles
    T-SQL e-book by TechNet Wiki Community
    T-SQL blog

  • Concatenate two Columns in OAF

    Dear Friends ,
    I have a OAF Page developed with advanced table , i would like to concatenate first two
    columns . is there any way that i can achieve this ?
    Note : I am using a sear without entity Object ( VO based Search )
    Please share your thoughts .
    Thanks in Advance ,
    Keerthi.k

    There are multiple ways to do it.
    Fully Declarative Way
    1. Add transient variable to your VO.
    Expand Attributes in VO Editor, select the newly created attribute, Check 'selected in query' checkbox.
    in Query Column, give some alias, enter expression as <column1> || <column2>
    Fully Programmatic Way
    1. Add transient variable to your VO.
    2. Capture the event in CO...pass the control to AM...from AM pass the control to VOImpl.
    3. Loop thru VO using an iterator.
    4. create a method in VORowImp to concatenate the two column and populate into the attribute created in step 1 (Use populateAttribute(.., ..) so that the VORow is not dirtied)
    5. for every row, call the method created in step 4.
    Hrishikesh

  • How do I count the unique value pairs in two columns of a table?

    I have a table (Table 2) that is populated with data from an imported .csv file. On table 1 I need to count the unique value pairs in two columns of Table 2.
    Here's what I have:
    Date                                        Person
    7/10/2011                         A
    7/12/2011                         W
    7/12/2011                         X
    7/12/2011                         X
    7/12/2011                         X
    7/12/2011                         Z
    7/14/2011                         Z
    7/15/2011                 X
    7/16/2011                         Z
    I'm focusing on person "X" and can easily count how many days that person shows up but what I want is to see on how many unique days that person shows up.
    Here's the result I'm looking for (Person "X" shows up on 2 different days - 3 times on 7/12/2011 and once on 7/15/2011):
    X                    2
    I can't seem to find a function that allows me to do that. I also am not allowed to modify Table 2 so that leaves me to come up with a solution on Table 1.
    Any ideas would be greatly appreciated.

    Hi John,
    Not being allowed to modify Table 2 is a minor inconvenience. Just copy (using a formula) the necessary two columns onto Table 1.
    Yellow columns may be hidden. The procedure progresses from left to right. All formulas are entered into row 2 then filled down that column to the end of the table. The table must be as long as the list in column A of Table 2.
    A2: =Table 2::A
    Fill right to column B.
    Fill both columns down as far as needed.
    I've used actual Date and Time values in column A, formatted to show only the Date part, but the technique will work with text in these cells, provided all cells representing the same 'date' have exactly the same content.
    C2: =A&B
    This concatenates the contents of each row of columns A and B into a single text string.
    D2: =COUNTIF($C$2:C2,C)
    This counts the number of occurrences of the Date&Name string on the current row from the first regular cell in column C (C2) to the current cell.
    E2: =IF(COUNTIF($B$2:B2,B)=1,MAX($E$1:E1)+1,"")
    This constructs the index of first occurrences of each name, in the order they first occur. The index is used by LOOKUP in column F.
    F2: =IF(ROW()-1>MAX(E),"",LOOKUP(ROW()-1,$E,$B))
    This uses the index value created in E as a search-for value to extract a single copy of the names in column B. The result is a list of all distinct names in the list. Note that spelling differences will be counted as distinct names.The IF statement stops the listing when the last distinct name is extracted.
    G2: =IF(LEN(F)>0,COUNTIFS($B,"="&F,$D,"=1"),"")
    This counts the number of 'first occurrences of distinct Date & Name strings for each name on the list (ie. the number of distinct dates on which each name appears in the original list).
    All of the functions used are described, with at least one example for each, in the iWork formulas and Functions User Guide. You can download the guide, and the Numbers '09 User Guide, via the Help menu in numbers.
    Regards,
    Barry

  • Compare two columns and match ALL recurring values, not just the first instance

    Hi everybody...
    I was looking for a way to compare values in two columns, identifying every duplicate value instance on a third column.
    Searching around the forums, I found a solution, albeit a partial one; I am using this formula: =IFERROR("Duplicate in row "&MATCH($A,$B,0),"") along column C, to compare values between columns A and B. When applied, the formula will render the first instance where there is a duplicate; unfortunately MATCH will only register the first instance of the duplicated values.
    For example:
    The first value on column A is 'Apple'. On column B there are three instances for the value 'Apple', the formula identifies the first of these values, but not the remaining two.
    I am not an advanced Numbers or Excel user, and the answer to this problem eludes me. I am attempting to compare columns that have no less than 1000 rows each, so you can imagine how, finding a solution to my problem would be really great.
    Thanks in advance,
    Pablo

    Unfortunately I can't see your screenshot, but supposing you have a table like this:
    Col1
    Col2
    1
    3
    Dupe
    2
    4
    Dupe
    3
    5
    Dupe
    4
    6
    5
    7
    Then here is one way to flag the duplicates.
    The formula in C2, copied down, is:
    =IF(COUNTIF($A,$B2)≥1,"Dupe","")
    Then filter on column C for 'Dupe', and copy the values in column B to wherever you need them.
    SG

  • Getting DISTINCT count from two different columns

    Hi all,
    I have following query which gives currency code from two different tables. I would like to get the distinct count of currency codes from these two different columns.
    SELECT eb.person_seq_id, eb.bonus_amount, eb.currency_cd, ed.currency_cd_host
    FROM fr_emp_bonuses eb, fr_emp_details ed, fr_periods p
    WHERE eb.person_seq_id = ed.person_seq_id AND ed.period_seq_id = eb.period_seq_id
    AND ed.period_seq_id = p.period_seq_id AND p.period_status = 'CURRENT'
    AND eb.bonus_amount >= 0 AND eb.person_seq_id = 3525125;
    This query gives following result
    3525125     240000     USD     INR
    3525125     0      USD     INR
    3525125     60000      USD     INR
    3525125     50000      USD     INR
    There are two distinct currency codes (USD, INR) and total amount is 350000. So I am looking for a query to give me the following result
    3525125     350000 2
    Thanks in advance

    Hi,
    Here's one way:
    WITH     original_query     AS
         SELECT  eb.person_seq_id
         ,     eb.bonus_amount
         ,     eb.currency_cd
         ,     ed.currency_cd_host
         FROM     fr_emp_bonuses         eb
         ,     fr_emp_details          ed
         ,     fr_periods          p
         WHERE      eb.person_seq_id    = ed.person_seq_id
         AND      ed.period_seq_id    = eb.period_seq_id
         AND      ed.period_seq_id    = p.period_seq_id
         AND      p.period_status         = 'CURRENT'
         AND      eb.bonus_amount     >= 0
         AND     eb.person_seq_id    = 3525125
    ,     unpivoted_data     AS
         SELECT     person_seq_id
         ,     bonus_amount
         ,     currency_cd
         FROM     original_query
        UNION ALL
            SELECT  person_seq_id
         ,     0               AS bonus_amount
         ,     currency_cd_host     AS currency_cd
         FROM     original_query
    SELECT       person_seq_id
    ,       SUM (bonus_amount)          AS total_bonus_amount
    ,       COUNT (DISTINCT currency_cd)     AS distinct_currency_cds
    FROM       unpivoted_data
    GROUP BY  person_seq_id
    ;There may be a shorter, more efficient way to get the same results, but without knowing more about your tables, I can't tell.
    The tricky thing is getting two columns (currency_cd and currencuy_cd_host in this case) counted together. You can't simply say
    COUNT (DISTINCT eb.currency_cd) +
    COUNT (DISTINCT ed.currency_code_host)That happens to get the correct result with the sample data you posted, but what if you had data like thEe following?
    currency_cd     currency_cd_host
    INR          USD
    USD          INRHere, the count of distinct currency_cds is 2, and the count of distinct currency_cd_hsots is also 2. Does that mean the grand total is 2 + 2 = 4? No, the 2 codes in one column arte the same 2 codes as in the other column. We need to get both currency_cd and currency_cd_hsot into the same column, and then do COUNT (DISTINCT ...) on that combined column. A UNION, as shown above, will certainly do that, starting with your query as you posted it. The query you posted isn't necessarily the best frist step towards this result, however, so there may be a much better approach, depending on your tables.
    Edited by: Frank Kulash on Feb 1, 2012 6:21 PM
    Here's a slightly shorter, and probably more efficient way to get the same results:
    WITH     cntr     AS
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL     <= 2
    SELECT       eb.person_seq_id
    ,       SUM (eb.bonus_amount)          AS total-amount
    ,       COUNT ( DISTINCT CASE
                        WHEN  c.n = 1
                        THEN  eb.currency_cd
                        ELSE  ed.currency_cd_host
                      END
              )               AS distinct_currency_cds
    FROM       fr_emp_bonuses    eb
    ,       fr_emp_details    ed
    ,       fr_periods          p
    ,       cntr              c
    WHERE        eb.person_seq_id  = ed.person_seq_id
    AND        ed.period_seq_id  = eb.period_seq_id
    AND        ed.period_seq_id  = p.period_seq_id
    AND        p.period_status   = 'CURRENT'
    AND        eb.bonus_amount   >= 0
    AND       eb.person_seq_i   = 3525125
    --       NOTE: no join condition involving c; we really do want a cross-join
    GROUP BY  eb.person_seq_id
    ;

  • OBIEE - Division of two columns that contain count formulas

    I am trying to define a column in a report which divides a column entitled Difference (Target counts - Actual counts)by the column in the report which stores the Target counts. The Target and Difference columns contain formulas which provide the Target counts and calculates the difference between the Target counts and the Actual counts. The functions subtract and add seem to work fine, but when I use the division function I receive an incorrect result. What could I be missing here?

    When you mean "incorrect results" is that associated with only Grand Totals or entire result set?
    Also check if <ReportAggregateEnabled>true</ReportAggregateEnabled> is in instanceconfig.xml
    If none of the options above helped you,
    can you provide a sample extract containing 5 rows?
    -bifacts :-)
    http://www.obinotes.com

  • Populating a third column form the contents of lov result the first two

    Hi,
    i have a form with three fields.
    The first two fields are LOV. The third is a text field.
    I would like to compile a third field concatenating the results of these two. I would also check that the third field does not exceed the 30 digit value.
    e.g.
    first field --> country
    lov
    FRANCE d, FR r
    ITALY d, IT r
    second field --> town
    lov
    PARIS d, PRS r
    MILAN d, MI r
    third filed
    PARIS FRANCE ( max 30 char)
    MILAN ITALY
    Any help?
    Thanks in advance
    lukx
    Apex 4.1
    rdbms 11.2

    lukx,
    Yes, you would extend your PL/SQL to use the LOV return values as your look-up to return your display values.
    Looking back your original question; why doesn't your database yield Paris France just by selecting Paris with just one LOV? Maybe you need a table that relates a city to a country.
    Jeff

  • Error in Word when creating two columns

    Hi, first of all, please excuse my bad English, it is not my primary language.
    I have a document and I need to "transform" a long passage to 2 columns to save some space. When I do this, something happens with the page count, also in the Index showing page numbers automaticly.
    The page that starts with the two columns get page number 1 instead of 5 or 6, and all the following pages with the two columns have this number and the first page after the two columns end gets number 2. I can not reproduce this error in Another document,
    But I do not understand why I get it in this.
    Here is a Link to my OneDrive containing Steps recorder .zip to show you.
    http://1drv.ms/1lqISNO
    Regards
    Martin

    Looks like splitting the passage has created a new section at the page and it has its own page numbering. Try this:
    1. Click anywhere in the wrong-numbered pages.
    2. Click the Insert->Page Numbers menu item.
    3. Click the Format Page Number… button.  
    4. Select Continue from previous section radio button.
    5. Click OK.
    Hope that helps.
    Thanks,
    Ethan Hua CHN
    TechNet Community Support

  • How to add two columns in criteria(OBIEE 11g)

    Hi,
    I am trying to add two columns in a criteria in obiee
    *"Fact - OLB Processed Invoices"."Invoice Amount - Functional Currency"__"Fact - OLB Processed Invoices"."AR Tax Amount - Invoice Currency"
    but the problem is :-
    The first column have 500000000 and the second column contains NULL values the actual table. I think this might be the problem when I am trying to add them it is giving no output.
    just a blank box.
    Can any one tell me how can we add columns in this condition.
    Thank to one and all.

    Try IFNULL(expr, value)
    for other column
    "Fact - OLB Processed Invoices"."Invoice Amount - Functional Currency"+IFNULL("Fact - OLB Processed Invoices"."AR Tax Amount - Invoice Currency",0)
    Edited by: Srini VEERAVALLI on Mar 20, 2013 10:02 AM

Maybe you are looking for

  • Tuning xml

    Hi, I have 2 tables as below (in similar format) having CLOB type column and these are range partitioned on the value_date column. CREATE TABLE I_TAB_A STG_RECORD_ID NUMBER NOT NULL, STG_LOAD_TIMESTAMP TIMESTAMP(6) WITH TIME ZONE NOT NULL, STG_STATUS

  • Solaris 8 x86 on an IBM PC Server 320

    I have an IBM PC Server 320 that I have spent days trying to install Solaris 8 04/01 on. I keep getting pboot: cdrom error 01 and Random reboots during the installation using the install CD or Software CD 1. I reviewed the Solaris HCL list and all th

  • Hierarchy ALV in ABAP OOPS

    Hi FOlks,             Have a requirement to develop Hierarchy ALV with two levels. As we need to make the columns as editable we are going for ALV OOPS. Is there any way of doing Hierarchy ALV in OOPS...if so, could you please suggest me which Class

  • Inheritance and access control - "private protected"

    I'm reopening an old topic, seems to have been last discussed here 2-3 years ago. It concerns the concept of restricting access to class members to itself, and its subclasses. This is what "protected" does in C++ and "private protected" did in early

  • Joining tables via SQL

    I am trying to join two tables.  I have a documents and uploads, of which user is common.  For the user, I would like results put out from the tables where it is owned by the same user.  So if they have two records in uploads, and one in documents, i