Alternatives to Dimension facts for row counts

Hi,
I currently have a data warehouse with 3 fact tables, they are all at an order line granularity.  I want to start looking to add some facts that perform a distinct count of related dimensions (like how many orders, how many customers, etc).
The method i have used is to create a measure group from the dimension in question (lets say customers) which allows me to use a count measure. 
While this approach works, i dont like the fact that there will be many measure groups presented in the user application.  What I would like to do is have 1 measure group that contains all the "counts" for the dimensions i want.
Is that possible?  If so, could somebody point me in the right direction?
Many thanks in advance,
Dominic

My 2 cents:
Whenever you create a distinct count measure, it creates addiitional measure group with same number of partitions as present in original measure group.
Here is an article on distinct measure group for tabular and the multidimenional model. This article explains how you can create
distinct measure group with single partition.
If this post answers your query, please click "Mark As Answer" or "Vote as Helpful".

Similar Messages

  • How to setup alert for row count mismatch in replication

    Hi All,
    I noticed that in our environment there was a row count mismatch between the publisher and subscriber.Still the replication monitor was showing excellent.I reinitialized the replication to resolve the issue.
    I want to set up alert row count mismatch alert between publish and subscrber tables before the client tells it to me.How this can be done?
    Thanks!

    There is an alert called - Replication: Subscriber has failed data validation - use that in conjunction with a validation.
    looking for a book on SQL Server 2008 Administration?
    http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search?
    http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

  • Report.Services 2008 - get page-count or row-count in the c#-code

    hello
    is it possible to get from the ReportViewer-control / ServerReport the page-count or row-count after the
    reportViewerCheck.ServerReport.Refresh();
    statement ??
    many thanks in advance for any clue & regards
    Michael

    Hi Michael,
    Yes, you can get them. For row count, you can add a parameter to store the row count of your dataset in your report.
    Here are the steps:
    1.     Add 2 datasets in your report, one for report use and the other on is to row count use. For instance:
    DataSet1: SELECT     HumanResources.vEmployee.* FROM         HumanResources.vEmployee
    DataSet2: SELECT     COUNT(*) FROM         HumanResources.vEmployee
    2.     Add a parameter, set the parameter’s default value set to Get Values from a query and select DataSet2.
    Then, in your ASP.NET web application code you can use the following function to get the row count of the report:
    private int GetReportRowCount(ReportViewer report)
                return Convert.ToInt32(report.ServerReport.GetParameters()[0].Values[0].ToString());
    For page count, you can refer to the following code:
    private int GetReportPageCount(ReportViewer report)
                return report.ServerReport.GetTotalPages();
    You may not get the correct row count and page count in after executing Refresh () method, that’s because when you run this method, it will start another thread to refresh the report and the code below Refresh () method will not wait refreshing complete but run it. For instance, you may get the page count as o if you run the following code in the Button event:
    // Click this Button to refresh the ReportViewer1
            protected void btnGetPageCount_Click(object sender, EventArgs e)
                // Refresh the ReportViewer1
                this.ReportViewer1.ServerReport.Refresh();
                // Get ReportViewer1's page count and display in the txtPageCount TextBox
                this.txtPageCount.Text = this.ReportViewer1.ServerReport.GetTotalPages().ToString();
    You can run the refresh in separate events and get page count in another event, such as below code:
            // Click this Button to refresh the ReportViewer1
            protected void btnGetPageCount_Click(object sender, EventArgs e)
                // Refresh the ReportViewer1
                this.ReportViewer1.ServerReport.Refresh();
            // Display the txtPageCount's text to ReportViewer's page count
            protected void btnGetPageCount2_Click(object sender, EventArgs e)
                // Get ReportViewer1's page count and display in the txtPageCount TextBox
                this.txtPageCount.Text = this.ReportViewer1.ServerReport.GetTotalPages().ToString();
    Hope this helps! I would suggest you post a new thread in Visual Studio Report Controls forum if you need more help about using ReportViewer in ASP.NET web application.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Cursor ORDER BY Clause Changing Row Count In BULK COLLECT ... FOR LOOP?

    Oracle 10g Enterprise Edition Release 10.2.0.4.0 running on Windows Server 2003
    Oracle Client 10.2.0.2.0 running on Windows 2000
    I have some PL/SQL code that's intended to update a column in a table based on a lookup from another table. I started out by testing it with the UPDATE statement commented out, just visually inspecting the DBMS_OUTPUT results to see if it was sane. During this testing I added/changed the cursor ORDER BY clause to make it easier to read the output, and saw some strange results. I've run the code 3 times with:
    1. no ORDER BY clause
    2. ORDER BY with two columns (neither indexed)
    3. ORDER BY with one column (not indexed)
    and get three different "rows updated" counts - in fact, when using the ORDER BY clauses it appears that the code is processing more rows than without either ORDER BY clause. I'm wondering why adding / changing an ORDER BY <non-indexed column> clause in a cursor would affect the row count?
    The code structure is:
    TYPE my_Table_t IS TABLE OF table1%ROWTYPE ;
    my_Table my_Table_t ;
    CURSOR my_Cursor IS SELECT * FROM table1 ; -- initial case - no ORDER BY clause
    -- ORDER BY table1.column1, table1.column2 ; -- neither column indexed
    -- ORDER BY table1.column2 ; -- column not indexed
    my_Loop_Count NUMBER := 0 ;
    OPEN my_Cursor ;
    LOOP
    FETCH my_Cursor BULK COLLECT INTO my_Table LIMIT 100 ;
    EXIT WHEN my_Table.COUNT = 0 ;
    FOR i IN 1..my_Table.COUNT LOOP
    my_New_Value := <call a pkg.funct to retrieve expected value from another table> ;
    EXIT WHEN my_New_Value IS NULL ;
    EXIT WHEN my_New_Value = <an undesirable value> ;
    IF my_New_Value <> my_Table(i).column3 THEN
    DBMS_OUTPUT.PUT_LINE( 'Changing ' || my_Table(i).column3 || ' to ' || my_New_Value ) ;
    UPDATE table1 SET column3 = my_New_Value WHERE column_pk = my_Table(i).column_pk ;
    my_Loop_Count := my_Loop_Count + 1 ;
    END IF ;
    END LOOP ;
    COMMIT ;
    END LOOP ;
    CLOSE my_Cursor ;
    DBMS_OUTPUT.PUT_LINE( 'Processed ' || my_Loop_Count || ' Rows ' ) ;

    Hello (and welcome),
    Your handling the inner cursor exit control is suspect, which will result in (seemingly) erratic record counts.
    Instead of:
    LOOP
    FETCH my_Cursor BULK COLLECT INTO my_Table LIMIT 100 ;
    EXIT WHEN my_Table.COUNT = 0 ;
    FOR i IN 1..my_Table.COUNT LOOP
    my_New_Value := <call a pkg.funct to retrieve expected value from another table> ;
    EXIT WHEN my_New_Value IS NULL ;
    EXIT WHEN my_New_Value = <an undesirable value> ;
    IF my_New_Value my_Table(i).column3 THEN
    DBMS_OUTPUT.PUT_LINE( 'Changing ' || my_Table(i).column3 || ' to ' || my_New_Value ) ;
    UPDATE table1 SET column3 = my_New_Value WHERE column_pk = my_Table(i).column_pk ;
    my_Loop_Count := my_Loop_Count + 1 ;
    END IF ;
    END LOOP ;
    COMMIT ;
    END LOOP ;Try this:
    LOOP
    FETCH my_Cursor BULK COLLECT INTO my_Table LIMIT 100 ;
    FOR i IN 1..my_Table.COUNT LOOP
    my_New_Value := <call a pkg.funct to retrieve expected value from another table> ;
    EXIT WHEN my_New_Value IS NULL ;
    EXIT WHEN my_New_Value = <an undesirable value> ;
    IF my_New_Value my_Table(i).column3 THEN
    DBMS_OUTPUT.PUT_LINE( 'Changing ' || my_Table(i).column3 || ' to ' || my_New_Value ) ;
    UPDATE table1 SET column3 = my_New_Value WHERE column_pk = my_Table(i).column_pk ;
    my_Loop_Count := my_Loop_Count + 1 ;
    END IF ;
    EXIT WHEN my_Cursor%NOTFOUND;
    END LOOP ;
    END LOOP ;
    COMMIT ;Which also takes the COMMIT outside of the LOOP -- try to never have a COMMIT inside of any LOOP.
    Additionally, not too sure about these:
    my_New_Value := <call a pkg.funct to retrieve expected value from another table> ;
    EXIT WHEN my_New_Value IS NULL ;
    EXIT WHEN my_New_Value = <an undesirable value> ;Any one of those EXITs will bypass your my_Loop_Count increment.
    Edited by: SeánMacGC on Jul 9, 2009 8:37 AM
    Had the cursor not found in the wrong place, now corrected.

  • There was an error while updating row count for "SH".."SH".CHANNELS

    Hi All,
    Am new to OBIEE.Pls help in this regard.
    Am building the physical layer as per Repository guide.When am importing the data in to this,am getting the below error.
    *"There was an error while updating row count for "SH".."SH".CHANNELS" :"*
    channles is the table name and having 5 rows.
    but am able to see the data in the sql prompt. like SELECT * FROM SH.CHANNELS then 5 rows data would be displaying..
    pls help in this regard and where is the excat problem?
    Thanks,

    what is the error?
    Make sure that your connection pool settings are okay..
    Make sure that, you are using correct driver in case of if you are using ODBC dsn..
    Also make sure that, your oracle server is running... TNS and Oracle server services

  • Unable to get the row count of supplier site for each supplier

    Hi,
    In the sourcing module, suppliers page is having an advanced table in which there is a field 'supplier' and another filed 'supplier sites' (supplier field is of type picklist).Now, how can i get the count of 'supplier sites' for each supplier???

    Hi sumit,
    Thanks for the reply, can u please help in writing the code to loop through the VO...
    I was trying to get the first row and then finding the count of supplier sites, but in each iteration of for loop(for each row) i am getting the same count value for each and every row...
    Code :
    int j=vo.getrowcount();//count of no. of rows
    for (int i=0;i<j;i++)
    row=(xxVORowImpl)rowsetiterator.getRowAtRangeIndex(1);
    int a=am.getSupplierSitesVO.getRowCount();//this is the view object in the pick list
    oapagecontext.writeDiagnostics(this,"value of   a is :"+a,1);
    this code is giving row count of last row of supplier.
    How to get the count for each and every row of supplier sites ?
    Thanks.

  • How to get row count(*) for each table that matches a pattern

    I have the following query that returns all tables that match a pattern (tablename_ and then 4 digits). I also want to return the row counts for these tables.
    Currently a single column is returned: tablename. I want to add the column RowCount.
    DECLARE @SQLCommand nvarchar(4000)
    DECLARE @TableName varchar(128)
    SET @TableName = 'ods_TTstat_master' --<<<<<< change this to a table name
    SET @SQLCommand = 'SELECT [name] as zhistTables FROM dbo.sysobjects WHERE name like ''%' + @TableName + '%'' and objectproperty(id,N''IsUserTable'')=1 ORDER BY name DESC'
    EXEC sp_executesql @SQLCommand

    The like operator requires a string operand.
    http://msdn.microsoft.com/en-us/library/ms179859.aspx
    Example:
    DECLARE @Like varchar(50) = '%frame%';
    SELECT * FROM Production.Product WHERE Name like @Like;
    -- (79 row(s) affected)
    For variable use, apply dynamic SQL:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Rows count all tables:
    http://www.sqlusa.com/bestpractices2005/alltablesrowcount/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Trying to get row counts for all tables at a time

    Hi,
    i am trying to get row counts in database at a time with below query but i am getting error:
    its giving me ora-19202 error..please advise me
    select
          table_name,
          to_number(
            extractvalue(
              xmltype(dbms_xmlgen.getxml('select count(*) c from '||table_name))
              ,'/ROWSET/ROW/C')
              count
        from all_tables;

    ALL_TABLES returns tables/views current user has access to. These tables/views are owned not just by current user. However your code
    dbms_xmlgen.getxml('select count(*) c from '||table_name)does not specify who the owner is. You need to change it to:
    dbms_xmlgen.getxml('select count(*) c from '||owner || '.' || table_name)However, it still will not work. Why? As I said, ALL_TABLES returns tables/views current user has access to. Any type of access, not just SELECT. So if current user is, for example, granted nothing but UPDATE on some table the above select will fail. You would have to filter ALL_TABLES through ALL_SYS_PRIVS, ALL_ROLE_PRIVS, ALL_TAB_PRIVS and PUBLIC to get list of tables current user can select from. For example, code below does it for tables/views owned by current user and tables/views current user is explicitly granted SELECT:
    select
          t.owner,
          t.table_name,
          to_number(
            extractvalue(
              xmltype(dbms_xmlgen.getxml('select count(*) c from '||t.owner || '.' || t.table_name))
              ,'/ROWSET/ROW/C')
              count
        from all_tables t,user_tab_privs p
        where t.owner = p.owner
          and t.table_name = p.table_name
          and privilege = 'SELECT'
    union all
    select
          user,
          t.table_name,
          to_number(
            extractvalue(
              xmltype(dbms_xmlgen.getxml('select count(*) c from '||t.table_name))
              ,'/ROWSET/ROW/C')
              count
        from user_tables t
    OWNER                          TABLE_NAME                                                          COUNT
    SCOTT                          DEPT                                                                    4
    U1                             QAQA                                                                    0
    U1                             TBL                                                                     0
    U1                             EMP                                                                     1
    SQL> SY.

  • Get row count for different tables to the same line

    How can I get the row count for different tables in one line:
    SELECT count(A), count(B), count(C) from table tb_a A , tb_b B, tb_c C;
    Thanks!

    >
    Hi,
    How can I get the row count for different tables in one line:
    SELECT count(A), count(B), count(C) from table tb_a A , tb_b B, tb_c C;Something like this? One of the many uses for CTE's - Common Table Expressions - AKA
    subquery refactoring. Worth getting to know - very handy!
    with acount as
      select count(*) as counta from dual  -- put your table name here
    bcount as
      select count(*) as countb from dual  -- put your table name here
    ccount as
      select count(*) as countc from dual  -- put your table name here
    select a.counta, b.countb, c.countc from acount a, bcount b, ccount c;HTH,
    Paul...
    Edited by: Paulie on 25-Jul-2012 17:44

  • Different Data sources for dimensions & Facts

    Hi
    Here is my scenario. For our POC purpose, we are just trying to access dimensions, & Facts from 2 different data sources.
    Dimensions come from db2 and Fact table comes from a different source.
    My question here is did any one faced issues like this ? I am wondering whether i need to join these tables physically in the phyical layer or should i have to take care of them in the BMM Layer.
    Thanks in advance for any of ur ideas

    As mentioned you will need to join across data bases. One thing you will see when you do this is that OBIEE will do a bulk select across those databases then join and filter logically in its own memory process. If you MUST join across databases at least propagate the common dimensions across both databases; that way at least OBIEE can do a semi-filtered grab of the data from each database before it joins the resultsets in memory.

  • FMS required for Row Level in Marketing document for Dimensions vs BP

    Dear All,
    I need some help in regards to the FMS in SAP Business One. I am trying to use Dimension in the row level of my marketing document. In Dimension 2 and Dimension 3 I have named them as Dimension 2 whose description is Regions and in Dimension 3 whose descrption is Area.
    Now in Cost Accounting I have setup the Profit Centers in Dimension 2 Region as under :
    Factor Code  Factor Description
    CD0201         Region 1_Asia
    CD0202         Region 2_Middle East
    Also I have setup the Profit Centers in Dimension 3 Area as under :
    Factor Code   Factor Description
    CD0201A       India
    CD0201B       Pakistan
    CD0201C       China
    CD0202A       Syria
    CD0202B       Saudi Arabia
    I have created a udf in the Business Partner Header as U_DCostRegion wherein I have set Valid Values for Field as under which the user will put
    Value            Description
    CD0201         Region 1_Asia
    CD0202         Region 2_Middle East
    In the Business Business Partner Territory the BP has been defined as per the Dimension 3 Area. In which for e.g C0001 territory is India, C0002 territory is Pakistan and so on
    Now my requirement :
    I want that if the user is doing a Sales Quotation or Sales Order from the Sales Quotation then in the Row level Dimensions column of Regions and Area automatically through FMS it should populate the data accordingly as to what is put in the BP master Data. For Example user is doing Sales Quotation for C0001 whose Area ( U_DCostRegion) is set as CD0201 Region 1_Asia and Territory is set as India then automatically in the Sales Quotation row columns of Region and Area values of CD0201 Region 1_Asia and CD0201A India should come.
    I think this requirement can be fullfilled by FMS but I am not able to do it from my end. Please advise what should be the FMS for it.
    Regards,
    Depika

    Dear Rahul,
    I am able to put the Region from the Business Partner UDF to the document Row of Region column with the FMS as SELECT $[OCRD.U_DCostRegion] as in the U_DCostRegion I had set Valid Values for Field as
    Value    Description
    CD0201 Region 1_Asia
    CD0202 Region 2_Middle East
    As in the Dimension in Marketing document it takes the Factor Code e.g CD0201 so I am able to handle it with the above FMS.
    But for the Area dimension I am not able to make the FMS because in the marketing document it takes the Factor Code means the Factor Code e.g CD0201A and its not linked to the BP Territory Table of OTER.
    I want a FMS which is linked with the OTER Table also as such if in the BP the territory ( avaliable in base product BP > General Tab > Territory ( where its defined as India for BP C0001) should link to CD0201A which is the Factor Code wherein the Factor Description is India.
    please advise in this regard.
    Regards,
    depika

  • Different row count for select versus insert in XML query

    Hi,
    I encounter a situation where a SELECT * returns a different rows count than an INSERT INTO... (SELECT *) by xmltable join. This makes no sense at all!!!
    In breif, I tried to convert xml data into traditional relational tables. I wrote an xml query to select data from xmltable... I checked row count. When I used "create table as select" that was the same query above, I got correct row count. However when I used "insert into select" that was the same query above, I got the wrong info in the table I just inserted.
    Does any one have any idea what caused this issue? Thanks for your help.

    DUPLICATE post
    count of rows in a schema tables

  • Problem w/: Error while getting estimated row count for view

    JDev 10.1.3 - Steps
    1. created a ADF VO w/ one bind variable vNAME.
    2. Created a basic jspx page, use the data control pal. to drop in VO w/ executeparam option. Use the data control pal to drop in VO w/ ADF Read-Only Table w/ select and sort option. Selected all VO columns in table.
    3. Following Error msg occurs when running jspx page -
    oracle.jbo.DMLException: Error while getting estimated row count for view object CategoryView, statement SELECT count(1) FROM (SELECT
    CATEGORY.CATID CATID,
    CATEGORY.NAME NAME,
    CATEGORY.PICTURE PICTURE,
    CATEGORY.ACTIVE ACTIVE
    FROM
    CATEGORY
    WHERE
    (CATEGORY.NAME LIKE UPPER(:vName)||'%')) .
    Tested SQL Statement in SQL Worksheet works ok (with a Value replacing ':vName').
    Can anyone advise - seems to be a straight forward process that is returning this error msg. I have tried variations of the SQL stmt with no luck. The jspx page errors when the ADF Read-Only Table is added.

    I seem 2 have the same error, in a slightly different situation.
    I have a view which subclasses a Entity with a history column 'CreatedOn'. When performing a quick search/filter on this column I get the same error. The ADF app is build on a DB2 database, so no named parameters here. Instead invalid SQL is created when executing the estimated row count. The WHERE clause contains 'CreatedOn = null', should be 'CreatedOn is null'. Furthermore the input of my quick search is not filled in this clause.
    Any help would be appreciated

  • Rows count for repetitive groups in tablix.

    Hi All,
    To make the story cut short, i will going to explain my scenario:
    i have a tablis contro and i garoup it by a field say "Field1" which contains A and B values,
    in my case we divide groups in two parts if it has rows more then 200.
    so, my report output and my required is below :
    Current Output -------------------------- Required layout
    here 200, 20, 30 are number of rows per group.
    now my requirement is if a group is repetitive
    i need the all rows count for that value like in above case :
    Header text of  Group A should be like : A(220) i.e 200 +20
    please help me on this...
    it is very urgent for me
    shashank

    hi Simon,
    thanks for reply, sorry, i skipped to mentioned that i have to provide multilevel grouping also, like 
    Group By: Field 1 -> Field 2 -> field3
    so, to achieve my requirement by Sql as solution has no problem if i do not have multilevel grouping, but i have to provide that and in that case the query will be like,
    “select distinct [column1],[Column2],[Column3],count(*) as rn from [table] group by [column1],[Column2],[Column3]”
    which is problematic in my case.
    so for doing this i need a solution apart from sql but by using SSRS Report end.
    Thanks again.
    Shashank

  • Method for finding row count after executing query

    Is there a method for finding the row count from the resultset after executing a query on a database ?

    The best way: read the data from the result set. If you read it into e.g. a LinkedList, size() will tell you how many rows you got. Or you could increment a counter.
    There are other ways, such as variants of ResultSet that do the read loop for you. But since you'll be doing the fetch loop anyway, those just add unnecessary work and moving parts.

Maybe you are looking for

  • How to upload a multistructured file in BDC program using gui_upload?

    I want to upload a multistructured file in BDC program...in which some structures are repeating for multiple records..how to do this.. BP_GEN_DATA     FR0100270154                         FR12345678902 BP_PAYMENT     FR     0123456789     01234567890

  • What's a good deal for renewing my Broadband?

    My phone and broadband contract is up for renewal soon. Last time I  renewed my BB contact for 12 months, and the deal was as follows. "Talk & Surf Plus" Package on option 1 at a cost of £14.99 per month, plus a one-off discount of £24. The package i

  • Why is the FactAdditionalInternationalProductDescription a fact table in the AdventureworksDW2008R2 database?

    Was wondering why this table is a fact table in the AdventureworksDW2008r2 database?  It has no measures that I can tell.  Here is the schema for the table.... [ProductKey] [int] NOT NULL, [CultureName] [nvarchar](50) NOT NULL, [ProductDescription] [

  • Direct billing option for an app - Droid2

    I was trying to purchase an app today -- one of the options was 'direct billing' through my provider.  I do not want to send credit card information over my phone, so I was hoping this would allow me to purchase the app and have it on my monthly Veri

  • XPATH not reading my xml properly.

    <?xml version="1.0"?> <xml class="1" index="0" xmlns="http://www.blablabla.com/lsr/blablalba"      xmlns:testBase="http://www.blablabla.com/lsr/blablalba" service="localservicepreordering">      <header>           <testBase:interfaceid>testid</testBa