Calculating distinct counts of dimension columns

Hi, OBIEE Gurus.  Here's today's question on the quiz show "Can this be done?".
Month
Region
Sales
# Months
# Regions
Jan-2013
East
1000
2
3
Jan-2013
Central
2000
2
3
Jan-2013
West
3500
2
3
Feb-2013
East
1250
2
3
Feb-2013
Central
1925
2
3
Feb-2013
West
3450
2
3
The # Months and # Regions columns are the goal today.  There are two months in this analysis (Jan-2013, Feb-2013), out of a total population of 96 months.  There are three regions in this analysis (East, Central, West) out of a total population of 7 regions.  I want those values (2 and 3, respectively) reflected in the # Months and # Regions columns.
I've tried various combinations of the usual suspects (count, count distinct, sum(count..., sum(count distinct... and so forth) but I haven't found the correct magic spell yet.  Any ideas?

I found one potential (but somewhat flawed) solution for # Months:
count(distinct aggregate("Facts"."Sales" at "Geographies"."Geography"."Total Locales"))
Region is part of my Geography hierarchy, whose highest level is Total Locales.  This says to calculate sales for each row for the Total Locales level, so essentially ignore the Region column.  The flaw here is that two different months that just happen to have exactly the same sales will only generate one distinct value of sales, so there is the potential to undercount.  (I can get around it with a minor calculation, but that's just another complication.)
It also seems rather clunky, because it has to be modified to accommodate any newly added columns and (basically) create a level-based fact for the highest level of every hierarchy represented except for the column of interest.  So it's not very pretty solution.
If you have anything more elegant, bring it on.

Similar Messages

  • Distinct count of dimension business key in fact table

    In my cube I have a fact table which joins to a patient dimension.  The patient dimension is a type 2.  What I would like to do is get a distinct count of patients who have records in the fact table.   The business key in the patient dimension
    is the PrimaryMrn.  So a SQL query would look like this.
    SELECT count(distinct PrimaryMrn)
    FROM EncounterFact e
    INNER JOIN PatientDim p
    on e.PatientKey = p.PatientKey
    Is it possible to do this via MDX?
    Thanks for the help.

    If you have to distinct count an attribute in a SCD 2, you might choose between:
    Denormalizing that attribute in the fact table, and the create a classical DISTINCT COUNT measure
    Use a many-to-many approach - see the "Distinct Count" scenario in the Many-to-Many White paper here:
    http://www.sqlbi.com/articles/many2many (for both Multidimensional and Tabular
    If you use Tabular, you might want to read also this pattern:
    http://www.daxpatterns.com/distinct-count/
    Marco Russo http://www.sqlbi.com http://www.powerpivotworkshop.com http://sqlblog.com/blogs/marco_russo

  • How to get a distinct count of multiple columns

    I've done this before and I'll be darned why I can't recall this.
    Table with 3 columns with the primary key defined in column a.
    Row a b c
    num.
    1 020 how abc
    2 030 why def
    3 010 not ghi
    4 040 how abc
    5 050 yes def
    6 060 why def
    So what I want is a count of the unique values for columns b and c as if b and c were actually one field.
    So the result of the query would be:
    Count = 4 unique rows.
    Hopefully I'm making some sort of sense. It's a bit much to ask about the number of occurrences of each duplicate value, I'm sure just getting count of the unique rows of the non-indexed rows will be sufficient. Since the query is meant to be universal for multiple columns of numeric and alphanumeric data and can be expanded for multiple columns, I am simply trying to get a basic skeleton that works for an "on the fly" analysis.

    Thanks to all of you. I had the idea and just couldn't nail it down. You did it.
    All of you understood what I poorly communicated. My apologies for the lack of prep with a table, I was running patches on the system and couldn't dare interrupt it on my laptop and starting Oracle 11 while Micro$lop was patching all sorts of evil code. This is something I'm setting up on my own time so it's a work I'm going to try to be proud of. So there will be plenty of instrumentation and debugging code for timing.
    I'd thought of concatenating columns and was worried it wouldn't backport to older Oracle versions (work goes back to 8.1.7) with nulls and other goofy things like long raw fields or lob/clobs plus the other DBs that are at various sites. What I'm trying to do is improve on a crappy data analysis tool SAP provides to use with reporting unique columns. (Basis people could recognize this as DB05). I tried dragging out the SQL that their ABAP/4 language generates from an SQL trace but it was unusable and often dies on internal storage which on most sites is about 4GB per process. Needless to say, the program is wasteful and I'm trying to keep the work on the DB where it belongs and discourage cowboys from doing this in the DB on the fly and at the same time make it simpler for junior members to use while having a semblance of an audit trail.
    What I'm trying to do is work out a tool that checks all the crappy secondary indexes that were created by folks who seem to think in ways that are from an alien species not yet speculated about even with the strongest psychedelics. One of them actually decreases performance by a minimum factor of 5. It's not much when it's 5 seconds but when the response time averages about 3 hours beforehand, you can imagine what it was like afterward. In this particular case, the "logic" was that the index needed to be defined by the order of the fields of the select clause. Some myths never die. So it's not easy to work out which ones haven't been used in a long time, so it's down to finding which of the custom ones are actually bad in terms of selectivity. Some of these may have made a little bit of sense when the system was started up, now that some of these have millions of rows instead of a few thousand, thaw tend to expose the flaws in design.
    I'm also trying to make this work on multiple DBs such as DB2, MaxDB and (sob) SQL Squealer. The idea is to write this in ABAP code as a utility without the overhead of internal tables in ABAP as some of these tables are many millions of rows and I have to account for the size in memory. (ABAP field sizes in internal memory are generally much larger than the actual DB lengths. so every bit helps!) So I'm trying to create actual SQL on the fly and use it internally without going through the SAP DB interface which limits the type of SQL functions used and all the overhead. It's intended to grab a secondary index and if there are more than 2 fields defined, work it backwards to show unique values for all columns, all columns - 1, all columns - 2 and so on back to the initial column in the index.
    Why does this seem important? On Oracle I can generate histograms but those can often screw up SAP. On other DBs, the indexing cardinality is much more important, particularly with DB optimizers that make some odd decisions. So I need evidence I can push to folks who will only understand if there's a plain and simple analysis that explains it (almost) in crayon.
    I'm testing null values next (which worked!) but these suggestions all seem to follow the same idea which won't work in ABAP without some serious memory issues. So I'm down to this type of coding:
    exec sql.
    <dynamically generated true SQL>
    end-exec.
    rather than using ABAP with their concept of "open SQL" and the DB interface with all the overhead.
    RB's suggestion of the UNION ALL wasn't quite what I was looking for BUT it made me think that this would be a nice enhancement for evaluations!
    So the candidates that seem to work for what I wanted are as follows:
    SQL> SELECT COUNT (MIN (0)) AS distinct_col3_col4_cnt
    2 from rb group by b, c;
    DISTINCT_COL3_COL4_CNT
    7
    select count(distinct(b || c)) num_rows from rb;
    So thanks also to Frank, APNL and Nimesh for their examples. Now the fun starts as I spec out the processing.

  • Distinct count on multiple columns

    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE     10.2.0.1.0     Production"
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    select  distinct USERID,REG_DATE,COUNT(*) CNT from REGISTRATION where TRUNC(REG_DATE)>TO_DATE('01-NOVEMBER-2012','DD-MONTH-YYYY')
    and REG_ID not in (select REG_ID from REG_SEG_CAT) group by USERID,REG_DATE  
    41     27-NOV-12     1
    43     27-NOV-12     1
    43     27-NOV-12     1any idea how to show count=2 for userid 43
    Edited by: 946207 on Dec 4, 2012 2:11 PM

    Hi,
    How could we know if you don't show us your input data?
    Please read SQL and PL/SQL FAQ
    Additionally when you put some code please enclose it between two lines starting with {noformat}{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

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

  • DAX query to calculate distinct count respect to a column after a Filter function - SSAS 2012 Tabular

    Hi,
    I'm trying to build the dax query to determine the distinct count for a column returned by the application of a Filter function.
    evaluate(
    row("counter",
    countrows(
    filter(order_summary,
    year(order_summary[change_date]) = 2013) )
    I need to count the distinct values for an id returned by the Filter function.
    Any helps, please? Thanks

    Hi pscorca,
    According to your description, you want to calculate the distinct values for records where change_date is 2013. Right?
    In this scenario, we can use the DISTINCT() function within COUNTROWS(). Please try the expression below:
    =calculate(
    countrows(distinct(order_summary[column])),
    Filter('order_summary', year(order_summary[change_date])=2013)
    Reference:
    Distinct Count Measure in PowerPivot using DAX
    Related Distinct Count
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Running Total & Distinct Count Query

    Crystal 10.0.0.533 CR Professional
    Hope you can assist.
    I have a report listing deals signed, each deal has a corresponding category i.e. industry type, Accountant, Chiropractor, Financial Services, etc.
    I am undertaking a Distinct Count on these categories so that in the group footer it is showing number of different categories signed in a period (the report is grouped into different date periods). This is working OK.
    However, I need to EXCLUDE the category from this distinct count if the deal value is zero.
    I have tried using a formula to show a blank field if the value is zero, however it appears to be distinctly counting the blank as a category?
    Any assistance would be much appreciated.
    Tracy

    Deffinetly it will be less than what you expect for grand total. It is because when you are calculating distinct count for each group suppose
    Group A has categories A,B,C,D-->distinct count (4)
    Group B has C,D,E,F-->distinct count (4)
    but while calculating grand total then the distinct count will be
    A,B,C,D,E,F --> grand total (6) but not (8).
    In this case you need to use mannual running total like this
    whileprintingrecords;
    numbervar i;
    i:=i+{running total};
    place this in group footer and create another fomula like this
    whileprintingrecords;
    numbervar i;
    place this in report footer to get the correct grand total.
    Regards,
    Raghavendra

  • How to get Distinct Count of Products across two dimensions

    Hi,
    I have two dimensions, Item and Presentations. I need to get distinct count of products for IMD_Id + Merc_Pres_Id. IMD_Id is the lowest member in Item and Merc_Pres_Id is lowest in Presentation. My MDX query is given below but when I apply filters to
    slice it, it does not work and does not give right count. It always gives the count for all.
    /* Last Year Demand - Demand for 12 months back of selected months */
    With
    Member [Measures].[LYDemand]
    as
    Sum(
    Generate(
    EXISTING[All Date].[Fiscal Month Name].[Fiscal Month Name].Members,
    {parallelperiod([All Date].[Fiscal Month Name].[Fiscal Month Name], 12
    ,[All Date].[Fiscal Month Name].CurrentMember)}
    ,[Measures].[Proj Demand]
    /* Last to last Year Demand - Demand for 24 back of selected months */
    Member [Measures].[LLYDemand]
    as
    Sum(
    Generate(
    EXISTING[All Date].[Fiscal Month Name].[Fiscal Month Name].Members,
    {parallelperiod([All Date].[Fiscal Month Name].[Fiscal Month Name], 24
    ,[All Date].[Fiscal Month Name].CurrentMember)}
    ,[Measures].[Proj Demand]
    /* Current Year Active Products */
    Member [Measures].[CYCount]
    as
    CASE
    WHEN
    [Measures].[Proj Demand] > 0
    THEN
    DistinctCount(Existing(([All Items].[IMD Id].[IMD Id],[All Merchandise Presentations].[Merch
    Pres Key].[Merch Pres Key])))
    ELSE
    NULL
    END
    /* Last year Active Products */
    Member [Measures].[LYCount]
    as
    CASE
    WHEN
    [Measures].[LYDemand] > 0
    THEN
    DistinctCount(([All Items].[IMD Id].[IMD Id],[All Merchandise Presentations].[Merch Pres Key].[Merch Pres
    Key], [All Items].[Style Name].CurrentMember, (StrToMember('[All Date].[Fiscal Month Name].&[201401]',CONSTRAINED).Lag(12)
    : StrToMember('[All Date].[Fiscal Month Name].&[201411]',CONSTRAINED).Lag(12))))
    ELSE
    NULL
    END
    /* Last to last Year Active Products */
    Member [Measures].[LLYCount]
    as
    CASE
    WHEN
    [Measures].[LLYDemand] > 0
    THEN
    DistinctCount(([All Items].[IMD Id].[IMD Id],[All Merchandise Presentations].[Merch Pres Key].[Merch Pres
    Key], [All Items].[Style Name].CurrentMember, (StrToMember('[All Date].[Fiscal Month Name].&[201401]',CONSTRAINED).Lag(24)
    : StrToMember('[All Date].[Fiscal Month Name].&[201411]',CONSTRAINED).Lag(24))))
    ELSE NULL END
    SELECT
    [Measures].[CYCount], [Measures].[LYCount], [Measures].[LLYCount],
    [Measures].[Proj Demand],[Measures].[LYDemand],[Measures].[LLYDemand]
    ON
    COLUMNS,
    Non
    Empty([All Items].[Demand Center Name].[Demand Center Name], [All Items].[Style Name].[Style Name])
    ON ROWS
    FROM
    (SELECT (StrToSet('[All Items].[Style].[ALL]'))
    ON COLUMNS
    FROM
    (SELECT (StrToSet('[All Items].[Demand Center].[ALL]'))
    ON COLUMNS
    FROM
    (select (STRTOSET('[All Items].[Merch Group].&[MG-110]'))
    on Columns
    FROM
    (SELECT (StrToSet('[All Merchandise Presentations].[Merch Pres Chnl Dkey].&[MPC-1]'))
    ON COLUMNS
    From
    [FMI Forecasting]
    WHERE {strToMember('[All Date].[Fiscal Month
    Name].&[201401]',CONSTRAINED) :
    StrToMember('[All Date].[Fiscal Month Name].&[201411]',CONSTRAINED)}
    Requirements are as follows:
    1. Distinct Count should not include products where Proj Demand is 0, when I am using Filter function to remove products with 0 demand, query is really slow and execution time goes up from 35- 40 secs to 8-9 Minutes.
    2. When we apply filter (parameters) Distinct Count should be in the context of filters( which are mentioned in the select statement like Style, Demand Center and Merch Group). Currently after applying filters count does not change.
    Thanks for help.

    Hi Skd78,
    Thank you for your question. 
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Distinct Count Calculation

    Hello everybody,
    I have a cube with appointments including dimensions for companies and dates.
    One of my measures is "Appointments" which is the count of all appointments. Another calculated member is "Visits" which is the count of appointments with the type of "Visits".
    This is my MDX epxression for "Visits":
    AGGREGATE([Appointment].[Type].&[Visit], [Measures].[Appointments])
    Now I would like to create a new calculated member "Company Visits" which should be the distinct count of "Visits" by company and date.
    Example: 2 "Visits" in one company on the same day should be 1 "Company Visit"
    In T-SQL this query works:
    COUNT(
    DISTINCT(
    CASE [Type]
    WHEN "Visit" THEN CAST([CompanyID] AS NVARCHAR) + CONVERT(NCHAR(8), CAST([Date] AS NVARCHAR))
    ELSE NULL
    END
    ) AS [Company Visits]
    How can I do this with MDX in calculations?
    Additionally I would like to have a calculated member "Days in Field" as distinct count of dates with "Visits".
    Thanks in advance and best regards
    Lars

    Hi Lars,
    Based on your description, you want to create a new calculated member to calculate the distinct count of "Visit" for each company, right? In this case, you can use DistinctCount to achieve your requirement, here is a sample query about DistinctCount function
    for your reqerence.
    with member [DistCount] as
    distinctcount(exists(Employee.Employee.children,,"Reseller Orders"))
    Select {[Measures].[Reseller Order Count],
    [Measures].[DistCount]} on 0,
    ([Employee].[Gender].children) on 1
    From [AdventureWorks]
    Reference:DistinctCount (MDX)
    Regards,
    Charlie Liao
    TechNet Community Support

  • Distinct count of role-played dimension attribute

    Needed distinct count of AccountGroup attribute of AccountB dimension which is a role played dimension of Account.
    Added measure distinct count of the dimension attribute (AccountGroup). In dimension usage added the main fact table as intermediate for other dimensions with many2many relationships.
    The two role played Account dimensions must be related to the new AccountFact table with fact relationship.
    But then how will I be able to count distinct attribute of
    certain Account dimension (out of the two role played dimensions)???
    Namnami

    Thanks for the links, they are useful. But still they do not explain how to manage a distinct count of
    certain role played dimension attribute. 
    I gave up on this and added that dimension attribute to the fact table so now I do a regular distinct count on a cube fact measure. 
    Thanks
    Namnami

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

  • Count Distinct based on another column in the same table

    Hello,
    My question in short: is is it possible to add a new column to a view which holds the DISTINCT COUNTS of values/domains of another column in the same view?
    For example, in the below table the column "Distinct Count of Occurence" shows how many distinct values a person has in the Occurence column. So AAA has 1 and 2 therefore it is 2 distinct values etc.
    My issues is that I can retrieve unique values bu Count (Select Occurence)but I can not add the new column that would add the records to the corresponding Persons in the above table.
    Is there an easy way to achieve this on the DWH level or should it be done with MDX in the cube?
    Thanks

    Hi,
    Below a solution to use the view by adding a column with window functioning, maybe this will help.
    CREATE TABLE #TMP
    PERSON VARCHAR(10),
    OCCURENCE SMALLINT
    --DROP TABLE #TMP
    INSERT INTO #TMP(PERSON,OCCURENCE)
    VALUES
    ('AAA','1'),
    ('AAA','2'),
    ('BBB','1'),
    ('BBB','1'),
    ('BBB','1'),
    ('CCC','1'),
    ('CCC','2'),
    ('CCC','3');
    --TRUNCATE TABLE #TMP
    WITH CTE
    AS
    SELECT PERSON
    ,OCCURENCE
    ,ROW_NUMBER() OVER(PARTITION BY PERSON ORDER BY OCCURENCE) AS RN
    FROM #TMP
    SELECT PERSON, MAX(RN) AS RN
    FROM CTE
    GROUP BY PERSON
    Regards,
    Reshma
    Please Vote as Helpful if an answer is helpful and/or Please mark Proposed as Answer or Mark As Answer when question is answered

  • Distinct Count doesn't return the expected results

    Hi All,
    I was fighting a little trying to implement a Distinct Count measure over an account dimension in my cube. I read a couple of posts relateed to that and I followed the steps posted by the experts.
    I could process the cube but the results I'm getting are not correct. The cube is returning a higher value compared to the correct one calculated directly from the fact table.
    Here are the details:
    Query of my fact table:
    select distinct cxd_account_id,
              contactable_email_flag,
              case when recency_date>current_date-365 then '0-12' else '13-24' end RECENCY_DATE_ROLLUP,
              1 QTY_ACCNT
    from cx_bi_reporting.cxd_contacts
    where cxd_account_id<>-1 and recency_date >current_date-730;
    I have the following dimensions:
         Account (with 3 different hierarchies)
         Contactable Email Flag (Just 3 values, Y, N, Unknown)
         Recency_date (Just dimension members)
    All dimensions are sparse and the cube is a compressed one. I defined "MAXIMUM" as aggregate for Contactable Email flag and Recency date and at the end, SUM over Account.
    I saw that there is a patch to fix an issue when different aggregation rules are implemented in a compressed cube and I asked the DBA folks to apply it. They told me that the patch cannot be applied because we have an advanced version already installed (Patch 11.2.0.1 ).
    These are the details of what we have installed:
          OLAP Analytic Workspace       11.2.0.3.0 VALID
          Oracle OLAP API 11.2.0.3.0 VALID
          OLAP Catalog 11.2.0.3.0 VALID
    Is there any other patch that needs to be applied to fix this issue? Or it's already included in the version we have installed (11.2.0.3.0)?
    Is there something wrong in the definition of my fact table and that's why I'm not getting the right results?
    Any help will be really appreciated!
    Thanks in advance,
    Martín

    Not sure I would have designed the dimensions /cubes as you,  but there is another method you can obtain distinct counts.
    Basically relies on using basic OLAP DML Expression language and can be put in a Calculated Measure, or can create two Calculated measures
    to contain each specific result.  I use this method to calculate distinct counts when I want to calculate averages, etc ...
    IF account_id ne -1 and (recency_date GT today-365) THEN -
    CONVERT(NUMLINES(UNIQUELINES(CHARLIST(Recency_date))) INTEGER)-
    ELSE IF account_id ne -1 and (recency_date GT today-730 and recency_date LE today-365) THEN -  
    CONVERT(NUMLINES(UNIQUELINES(CHARLIST(Recency_date))) INTEGER)-
    ELSE NA
    This exact code may not work in your case, but think you can get the gist of the process involved.
    This assumes the aggregation operators are set to the default (Sum), but may work with how you have them set.
    Regards,
    Michael Cooper

  • Distinct count mdx fails

    Hi,
    I have a question about performing a distinct count of number of clients in my cube OLAP. 
    My clients-dimension table is populated from 4 different databases, this means that I can find the same clients with different Clients_ID (Natural key), because each client has a different ID in every database.  
    I want to calculate a distinct count on client’s phone number because it’s the same record in all Databases, I always get a big number which is not the right result.  I checked deeply the issue and I found that the query I set seems
    to not perform the distinct count right on the phone number.
    The small test I did with only filters (see screenshot below) let me believe that my query is performing the distinct count on each client ID instead of the phone number.
    Here it is the query I used to perform my distinct count:
    WITH SET MySet AS
    Filter(
    {[Dim Date].[Year].&[2014]} *
    {[DIM FA Clients].[FaCuNumberX].[FaCuNumberX]},[Measures].[QQT - Fact Ventes]>1 or [Measures].[QQT - Fact Ventes]=1)
    MEMBER MEASURES.SETDISTINCTCOUNT AS
    DISTINCTCOUNT(MySet)
    SELECT {MEASURES.SETDISTINCTCOUNT} ON 0
    FROM [CubeAll]
    I don’t know why the filter on this mdx query doesn’t work properly like an SQL group by.
    Thanks for help! 

    Hi Merouane,
    According to your description, you want to calculated to the numbers of client by count distinct Phone Number, right?
    In your scenario, you can add a distinct count measure in your project. Distinctcounts are one of the most demanding requests that can be placed on a MOLAP database, caused by the large number of dimensional attributes that typically exist in a cube. Here
    is a blog which describe several solutions for distinctcount in a SSAS project, please refer to the link below to see the detais.
    http://www.mssqltips.com/sqlservertip/3043/different-options-for-creating-a-distinct-count-measure-in-ssas/
    Regards,
    Charlie Liao
    TechNet Community Support

  • Distinct Count in Explorer

    This is from BOB post, which was posted in 2008. Now it's 2013 and there is no solution by SAP? We are doing a POC on Explorer, this is probably time to scrap it. Very frustrating! Is there any
    Hi,
    We have 2 tables used in universe "orders" and
    "order_line_product_item" from where we are pulling data in explorer indexes.
    We have issues getting distinct count of
    customers in explorer when we bring data from order line product item level
    facets/dimension.
    Just wondering if anyone else had solution of how to
    handle this on explorer side?
    At universe level we using count (distinct cust key), which is working at
    webintelligence.
    Looks like BO XI R3 further enhanced on handling this kind
    of situation by implementing delegated measures, but don't find anything similar
    to it in BO explorer.
    Occurrences is always getting us count at the lowest grain level(basically row level
    counts, but we are looking for distinct counts though !) .
    Is getting
    distinct counts limitation in explorer?
    Any help will be greatly
    appreciated.
    Thanks,
    ~SK
    Courtesy of Sachin

    Hello,
    So if you have a calculation(Webi) function(Excel) built into the two tables you are using from the data source you might try 'configuring' the data as 'Occurance' from the workspace you created or after the file in index if you're using excel.  If you are using a universe as a data source for the exploration view set you can attempt to drag the 'measure' needed (count) into the workspace option "measure" when creating the workspace.
    I do hope this helps

Maybe you are looking for

  • Can't install purchased app on another mac

    Attempting to mgirate from Snow Leopard to Lion.  Need to install purchased applications from Mac App Store on the Lion partition.  Signed in using same apple id as what I purchased the app with.  According to the MAS help, you should be able to find

  • Is there Anyway to print to an HP printer on an isolated network with an Android Phone?

    I've got a very unique situation and I have been unable to come up with a solution. I have a jobsite that needs a printer.  There is no internet at that location so I can't do a full blown eprint.  The other tweak is that the users only have Android

  • Black band

    I have a 30" ACD that has developed a grey/black area on the left side. It's not like the "bands" that other people have reported. This display is about 2 years old. We've tried it on another MacPro, with another video card, and on the other channel

  • Hyper Ram

    I am wondering there are some auctions on ebay that use the word HYPER in them. They sell for more. One is OPTIVAL ram. Is this good or bad or what. Is it worth the extra money for HYPER ram. The other is Macramdirect.com they are calling thiers hype

  • How to license Latin American Localization (JL) in Oracle Applications 11i

    Hi, How to license Latin American Localization (JL) in Oracle Applications 11i . Regards .