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.

Similar Messages

  • How to display the contents of the database values which are retrived.

    how to display the contents of the database values which are retrived in servlets and i am able to display the contents in the servlets and if forward to jsp using requestdespatcher,the values are to be shown in jsp one below the other.please suggest me in these........the servlet code is as shown
    while(rs.next()){
                        buffer.append(rs.getString(1));
                        buffer.append(rs.getString(2));
                        buffer.append(rs.getString(3));
                        buffer.append(rs.getString(4));
                        buffer.append(rs.getString(5));
                        buffer.append(rs.getString(6));
                        buffer.append(rs.getString(7));
                        buffer.append(rs.getString(8));
                        buffer.append(rs.getString(9));
                        buffer.append(rs.getString(10));
                        request.setAttribute("result1",buffer);
                        RequestDispatcher rq=request.getRequestDispatcher("/results.jsp");
                        rq.forward(request,response);
    in jsp iam using the getAttribute to retrieve the values as shown
    <% StringBuffer sb=(StringBuffer)request.getAttribute("result1"); %>
    <%= sb %>
    but getting the results in the stretch,i need to display the result one below the other.

    if you load it all into the buffer that is going to be very difficult. I would suggest loading it into some sort of collection. I like using an ArrayList.
    Then pass the arraylist.
    you will then on the jsp iterate through the arrayList using what every you want.. el, logic tags, scriplets.
    so something like
    ArrayList arrayList = new ArrayList();
    while(rs.next()){
    arrayList.append(rs.getString(1));
    //or possibly an arrayList of String arrays
    //maybe using nested for loops.  Inner for loop adds result to string[] then //outer adds string[] to arrayList.
    //can be done any number of ways based on your expected result set.

  • Segregate the values which are not in Hierarchy ............

    Hi All,
    Please help me in building the following query:
    Parent Child
    ==== ===
    10 20
    20 30
    30 40
    50 60
    70 80
    etc..... In the above data let us assue there is only one grand parent say 10 and the values 50,60,70,80 etc are not attached to grand parent 10.So i need to display the values which are forgotten to attach to the Top Node 10 i.e, here 50,60,70,80 etc. If my query helps in retreving these values then i can attach them back to the hierarchy.
    Thanks in advance.
    regards,
    kalyan

    SQL>WITH t AS
      2       (SELECT 10 AS par, 20 AS chi FROM DUAL UNION ALL
      3        SELECT 20, 30 FROM DUAL UNION ALL
      4        SELECT 30, 40 FROM DUAL UNION ALL
      5        SELECT 50, 60 FROM DUAL UNION ALL
      6        SELECT 70, 80 FROM DUAL)
      7  SELECT *
      8    FROM t
      9   WHERE chi NOT IN(SELECT     chi
    10                          FROM t
    11                    CONNECT BY PRIOR chi = par
    12                    START WITH par = 10);
           PAR        CHI
            50         60
            70         80hth, Urs

  • How to find out the values which are assigned in authority group

    Hi to all
    Please tell me where can I find out the values which are assigned in authority object according to roles.
    for ex :
             Changed    Customer: Account Authorization                              F_KNA1_BED
              Changed    Customer: Account Authorization                              T-DR50175601
                Activity                       01, 02, 03, 08                                                              ACTVT
                Authorization Group            5100                                                                        BRGRU
    F_KNA1_BED is the authority object , assigned to one user.
    He can access the authorization group 5100. I want to check that value in my program.
    How ?
    Where it is stored.
    Please help me....
    Regards
    Anubhav Gupta

    Hi Anubhav,
    Please use this FM "SUSR_USER_AUTH_FOR_OBJ_GET" and pass the object name in it . You would get the values for that particular object.
    Thanks
    Nitin Sachdeva

  • How to Get Resource value which are referred in code behind file using IResourceProvider

    Hi Everyone,
    Currently I'm working on moving the Resource file from "App_GlobalResources" to Database by using IResourceProvider. I created a CustomResourceProvider project using ResourceProviderFactory and able to get the resource values from DB which
    are used in aspx page.
    But i'm not able to get the values which are referring from code behind file.
    Ex: Label1.Text = Resources.Common.Car; // This is still coming from resx file.
    Can any one please let me know how to get the value from DB instead of resx file which are referred in cs file.
    Appreciate your help. 
    The below code uses the ResourceProviderFactory which calls this method and gets it from DB. Please let me know if you need any more info.
    public class DBResourceProviderFactory : ResourceProviderFactory
            public override IResourceProvider CreateGlobalResourceProvider(string classKey)
                return new DBResourceProvider(classKey);
            public override IResourceProvider CreateLocalResourceProvider(string virtualPath)
                 // we should always get a path from the runtime
                string classKey = virtualPath;
                if (!string.IsNullOrEmpty(virtualPath))
                    virtualPath = virtualPath.Remove(0, 1);
                    classKey = virtualPath.Remove(0, virtualPath.IndexOf('/') + 1);
                return new DBResourceProvider(classKey);
    Regards, Ravi Neelam.

    Hi Ravi Neelam.
    >>Currently I'm working on moving the Resource file from "App_GlobalResources" to Database by using IResourceProvider.
    Based on this message, your issue related to web application, questions related to Asp.Net should be posted in
    Asp.Net forum.
    Please reopen a new thread in that forum. You will get more efficient response.
    Regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Count the rows which are selected ?

    Hi Experts,
    I need help.My requirement is:
    I am having a table which can be multiple selected. But there are two buttons attached to it.Edit and Delete.For Delete I want the Multiple Selection not for EDit.So, If i will click the Edit after multiple selection of the rows.How i can give pop-up that multiple edit is not possible?Means I want to count the rows which are selected how to do that?
    Please guide me.
    Urgent need
    Regards
    Nutan

    Hi Nutan,
    Marcel is right about backend. However I might have an idea once I am developing a quiet similar solution. I would like to ask you to explain with more detail. It seems you have two requirements in one question.
    Regards,
    Gilson

  • Parameter field should pick the values which are there in the value table

    Hi Experts,
    I have a requ. where in a parameter field should pick only the values which are there in the value table for that particular field and should not allow the User to put in any other value.
    The value table is created in the program manually.
    EX:If the value table contains two sales organization VE03 and VE65 then the field shouldn´t allow anyother value other then those two.
    Thanks and Regards,
    Arun

    Try using a listbox.
    report  zrich_0001.
    type-pools: vrm.
    data: ivrm_values type vrm_values.
    data: xvrm_values like line of ivrm_values.
    data: name type vrm_id.
    parameters: p_vkorg(4) type c as listbox visible length 20.
    at selection-screen output.
      name = 'P_VKORG'.
      xvrm_values-key = 'VE03'.
      xvrm_values-text = 'VE03'..
      append xvrm_values to ivrm_values.
      xvrm_values-key = 'VE65'.
      xvrm_values-text = 'VE65'..
      append xvrm_values to ivrm_values.
      call function 'VRM_SET_VALUES'
           exporting
                id     = name
                values = ivrm_values.
    at selection-screen.
      if p_vkorg is initial.
        message e001(00) with 'Please enter a sales org'.
      endif.
    Regards,
    RIch Heilman

  • How exclude multiple values which are not in sequence ( range )

    Hi Abapers,
    My Requiremnt is to exclude multiple values which are not in sequence  in selection screen.
    I want to restrict some values .
    please provide sample code.
    thanks & regards,
    Hari priya

    SELECT-OPTIONS : s_matnr FOR mara-matnr.
    INITILIZATION.
    s_matnr-sign = 'E'.  " E means Excluding.
    s_matnr-option = 'EQ'.
    s_matnr-low = '1000'.
    append s_matnr.
    s_matnr-sign = 'E'.
    s_matnr-option = 'EQ'.
    s_matnr-low = '1500'.
    append s_matnr.
    s_matnr-sign = 'E'.
    s_matnr-option = 'BT'.
    s_matnr-low = '2000'.
    s_matnr-high = '3000'.
    append s_matnr.
    START_OF_SELECTION.
    SELECT * FROM MARA INTO TABLE itab WHERE mara IN s_matnr.
    the above s_matnr has values 1000,1500, 2000 - 3000.
    so the above code fetches all the values excluding 1000,1500 and between 2000 and 3000.
    Regards
    Bala Krishna

  • How can I convert (or switch) the RGB percent values from the LR histogram into RGB values which are shown e. g. in PS/CameraRAW?

    In LR 5.5 (same in previous versions) the RGB values in the histogram are shown in percent (relativ) values. I prefere to see the absolute values, but I can`t find any way to switch. Maybe this option is intentional disabled, because LR works in 16-Bit mode this would result in values up to 2^16. But as i compared the relativ values from LR with the absolute values from PS i run into a conversion problem. The following example shows the differences:
    CameraRAW : RGB, 128,0,0
    Lightroom: RGB, 43,8%, 19,0%, 6,2%
    CameraRAW: RGB, 0,128,0
    Lightroom: RGB, 29,8%, 47,5%, 17,5%
    Mainly i have two questions:
    1. Is there any possibility to change the percent RGB values in LR to absolut values?
    2. How can i convert CameraRAW values to LR values (see above)?

    TThe reason that a design decision was made from the beginning of LR to show only the percentage values was that RGB values are dependent on the color space and the LR histogram and numerical readout are derived from the Develop module's display space which is a hybrid color space with ProPhoto RGB primaries and the sRGB TRC. Thus the numerical values in the display would be different from the exported RGB image (in an orthodox space) and it was feared that this would be misleading. When soft proofing was introduced, because it involved converting the display to an orthodox space, it became possible to use the 0-255 scale in that mode.

  • Those values which are there in the IN list but  not in the table.

    Hi All,
    We have a table global_title_isbn having 18 columns with primary key on title_isbn. This table contains approx. 10 million rows.
    Normally what we used to get was 10-15 comma seperated list of ISBNs for some business process , for them we have to check into the table to figure out what all ISBNs are not there in the table.
    But now a days we are getting a list of more than 100 ISBNs and there are times when only less than 40 ISBNs exist in the table. So figuring out what all ISBN are not there in the given list is very tiresome job.
    Is there any way using SQL we get list of only those ISBN which are not there in the table from the list,
    eg
    select * from global_title_isbn where title_isbn in ( a comma seperated list);
    will give me those ISBNs which are there in the global_title_isbn and in the given list..
    Desired O/P
    a list of ISBN which are there in the given list but do not exist in the table.
    PS:-- I have only read access . I cannot create any table/view etc and PLSQL stored procedure.....
    Regards
    Vineet

    I see no problem with my solution.
    See examples below:
    create table global_title_isbn (title_isbn varchar2(10));
    insert into global_title_isbn values ('8888888');
    commit;
    -- your_string is '9999999','8888888','17262','19283263','328732'
    select rtrim(ltrim(extractvalue(list_isbn.column_value,'e'), ''''), '''') as title_isbn
      from table(xmlsequence
                  (extract
                    (xmltype('<coll><e>' ||replace(:your_string, ',', '</e><e>') ||'</e></coll>')
                  , '/coll/*') )
                ) list_isbn
    where not exists (select 1
                         from global_title_isbn gt
                        where gt.title_isbn = rtrim(ltrim(extractvalue(list_isbn.column_value,'e'), ''''), ''''));
    output:
    9999999
    17262
    19283263
    328732
    drop table global_title_isbn;
    create table global_title_isbn (title_isbn number(10))
    insert into global_title_isbn values (8888888);
    commit;
    -- your_string is '9999999','8888888','17262','19283263','328732'
    select rtrim(ltrim(extractvalue(list_isbn.column_value,'e'), ''''), '''') as title_isbn
      from table(xmlsequence
                  (extract
                    (xmltype('<coll><e>' ||replace(:your_string, ',', '</e><e>') ||'</e></coll>')
                  , '/coll/*') )
                ) list_isbn
    where not exists (select 1
                         from global_title_isbn gt
                        where gt.title_isbn = rtrim(ltrim(extractvalue(list_isbn.column_value,'e'), ''''), ''''));
    output:
    9999999
    17262
    19283263
    328732

  • Asset Value which are below 5000

    Hi,
    I have one requirement for the Assets which are below 5000 Value, Asset should be depreciated 100% as on booking date. They are not OK with creating
    either "Low values asset class or 100 % Depreciation Key". kindly let me know is there any other possible ways to achieve this?
    Thanks
    SV

    Hi SV,
    I understood the requirement but my question is what is the issue in creating a new depreciation key because that is the most appropriate way? If I use any other depreciation key which is not depreciating the asset to 100% then for audit purpose it will be very difficult to justify it.
    The only way of doing it without depreciation key is mass scrapping of asset using ABAVN. So either identify all those assets and mass scrap them or better create a new asset class for assets value less than 5000 currency units and mass scrap them.
    Regards
    Pankaj Pareek

  • How remove the values which are entered in filter attributes of VO

    Hi,
    On top of one VO we are performing search using bind variables.
    To refine the search we have added filterable="true".
    Now when we perform seach and then we have filtered using one column we got result and we proceeded.
    When we come to this screen again when i perform search with the bindvariable and click on search then the previously applied filter is also getting applied
    becuase the value in that filter is still there.
    So How can i remove the value which is entered in filter attribute of the VO programatically.
    Please help me.
    Regards
    Gayaz

    would this help you:
    http://adfscopes.blogspot.com/2011/03/programatically-clearing-filter.html

  • How best to display a two column menu in Flash 8?

    I have a flash 8 template and i am using Macromedia Flash Professional 8. I want to create a menu in a scrollable text box, which has two columns exactly aligned like so:
    Lamb                                                   £2.30                       Chicken                                                      £2.30                                                
    Minced lamb with onions, herbs,                                           Minced chicken with an mixture of
    in egg yolk and shallow fried.                                                green chillies cooked over a charcoal grill on
    Kebab                                                  £2.80                       Lamb                                                         £2.40
    A mix of chicken kebab, seekh kebab and                             Minced lamb mixed with gram flour, spices, green
    shami kebab.  Served on a sizzler.                                        chillies and herbs then deep fried.
    However, when i test the movie there is no formatting and the text is misaligned. I already have the above text (and there is alot of it) in the exact format, in a word file, so i could copy and paste the text instead of writing it out all over again.
    I have been advised that it is better to use the Datagrid component to display the above text in a table?
    My question is, how can i use the Datagrid component to display the text aligned exactly as above? Do i need to create html tables and then get the datagrid component to call this html file, xml file or actionscript? I am not familiar with xml or actionscript.
    Please can someone help?
    Thank you.

    Hi Ned. Apologies for late reply. Been away.
    Anyway, i have created an image of what it is i need. Please see the image below - menu.gif
    Not sure what the easiest way is to create such a two column menu in Flash because the tab key on the keyboard does not work in a scrollable textbox only the space bar. And using the space bar does not align the text correctly.
    However, i do have a html file which i created using html tables. Is there a way to import the html file into a scrollable textbox in flash? The raw html code example is a little different as i have included the borders, but the idea is the same - a two-column scrollable menu.
    Any help would be greatly appreciated.
    <html>
      <head>
        <title></title>
      </head>
      <body>
        <table width="50%" border="1">
          <tr>
            <td>
              <table width="100%" border="1" cellpadding="2"
              cellspacing="0">
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
                <tr>
                  <td>Other</td>
                  <td>10%</td>
                </tr>
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
                <tr>
                  <td>Other</td>
                  <td>10%</td>
                </tr>
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
                <tr>
                  <td>Other</td>
                  <td>10%</td>
                </tr>
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
              </table>
            </td>
            <td>
              <table width="100%" border="1" cellpadding="2"
              cellspacing="0">
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
                <tr>
                  <td>Other</td>
                  <td>10%</td>
                </tr>
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
                <tr>
                  <td>Other</td>
                  <td>10%</td>
                </tr>
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
                <tr>
                  <td>Other</td>
                  <td>10%</td>
                </tr>
                <tr>
                  <td>Apples</td>
                  <td>44%</td>
                </tr>
                <tr>
                  <td>Bananas</td>
                  <td>23%</td>
                </tr>
                <tr>
                  <td>Oranges</td>
                  <td>13%</td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </body>
    </html>

  • Using values which are linked to items in pop-up menu

    I want to link a list of products to one client that have a special prices which may differ from one client to another, is that possible in numbers?
    for example, if I choose client A, column B and C will Automatically linked to client A, and give me the products and prices that I have assigned before, lets say in another sheet or table,

    Hy Aymanala,
    Does this do what you want?
    The formula in C2 of Table 1, copied down, is:
               =INDEX(Prices::$A:$E,MATCH(A2,Prices::$A,0),MATCH(B2,Prices::$1:$1,0))
    This looks up the relevant price in the 'Prices' table based on the value you have in column A and column B on that row of 'Table 1'.
    SG

  • Export different value what we display in one column of answers

    I have a column which has almost 50 concatenated values by comma. I don't want to display all values to user in report. Just I will display "Multiple" instead of all these concat values. But when user export the report. User must see all concatenated values in that column.
    How can I achieve this?

    I do have a column in Oracle database  Contributor_List.  Which has following values in pipe separated way. There may be 50 values like in below example 3, 2 and 3 values are given.
    ABMB|BVAL|AFMY|
    ABMB|BVAL|
    MZSG|JSDP|DASJ|
    On OBIEE Answers, user want to get it displayed as "MULTIPLE" keyword because there may be 50 values. So these values will display as follows.
    MULTIPLE
    MULTIPLE
    MULTIPLE
    Now when exporting to excel, user again want to download the original value like   "ABMB|BVAL|AFMY|"  in place of "MULTIPLE"
    Just wanted to know how we can achieve this?

Maybe you are looking for