Counting fact table records within brackets

Hi,
I have a star schema setup in OBIEE, consisting of a fact table of transaction records, linked to a customer dimension and a time dimension via PK-FK relations.
One of the requirements is to count the number of customers based on how many transactions they have done per time period. I imagine solving this by creating logical colums such as "# customers (1-10 transactions)", "# customers (11-20 transactions)", etc. The counting should be based on the current level of drill-down in the time dimension.
Any advice on how to approach this would be greatly appreciated
best regards
M

Thanks for you reply, it brought me a lot closer to a solution. So far i've been able to create a bracket attribute on the customer dimension (via Answers and then into Administrator, as advised). I've verified this against the database, and it categorizes each customer correctly.
The remaining challenge is that I want to see the count within each category on an aggregate bracket level rather than per customer. Using one attribute ("customer bracket") which can take on one of several values (e.g. "0", "1-10", "11-20", etc.) i'm not sure how to accomplish this.
As a workaround i tried creating one column in Answers for each bracket, taking on the value 1 for records falling within that bin, and 0 for all other records. Treating the column as numeric, and adding a sub total (sum), i get the answers i want for each bin. The problem here however, is that one line (value 0 or 1) is shown for each customer record, which makes the report useless for most practical intents and purposes as thousands of records are shown.
Any thoughts on which method i should go ahead with, and how?
regards
M

Similar Messages

  • Record count is double in the Fact tables when compared to Cube data!

    Hello BW Gurus,
    I have 2 question to be answered!
    1. I have a cube which consist of 3 years of data. Due to some bad data in it, I have dropped the cube data completely from fact and dim tables and did an init. from ODS. the load failed due to "No SID found for value '2000000000000000000000010' of characteristic 0MAT_PLANT". I have run a RSRV test to find if there is any inconsistency in SID's for 0MAT_PLANT but everything looks great. Considering the time span in mind to finish the load I have removed that record from PSA and re-pushed the data from PSA which was successful, however I wanted to know if anyone has come across such kind of error.
    2. The load finished successfully in the cube but the performance of the cube was very bad coz my cube request shows only 3.5 million records but when I checked in the fact table it was showing double i.e. 7 million records, which is because I deleted the failed init. request and re-pushed the data from PSA. can anyone suggest me how to overcome this I mean how to bring back my fact table records to 3.5 million?
    please advise me and thanks so much!
    Swathi.

    hi Swathi,
    1. for 0mat_plant no sid, beside rsrv, you can try rsd1, infoobject maintenance, there is menu (about 3rd from left) 'fill sid ...'.
    for infocube update, please make sure you 'delete data',
    'fact and dim...'. check again if fact table counts 0 records then you can update from ods with 'initialize'. or if you go by psa then delete data both infocube and ods (from ods to cube should sufficient).
    2. for performance, check in infocube -> manage -> performance, make sure index and statistic is green. you can create index there, also refresh the statistic.
    hope this helps.

  • Duplicate record with same primary key in Fact table

    Hi all,
       Can the fact table have duplicate record with same primary key . When i checked a cube i could see records with same primary key combination but the key figure values are different. My cube has 6 dimentions (Including Time,Unit and DP) and 2 key figures. So 6 fields combined to form the composite primary key of the fact table. When i checked the records in se16 i could see duplicate records with same primary key. Ther are no parallel loading happening for the cube.
    BW system version is 3.1
    Data base is : Oracle 10.2
    I am not sure how is this possible.
    Regards,
    PM

    Hi Krish,
       I checked the datapacket dimention also. Both the record have same dimention id (141). Except the Keyfigure value there is no other change in the Fact table record.  I know this is against the basic DBMS primary key rule. But i have records like this in the cube.
    Can this situation arise when same records is there in different data packet of same request.
    Thx,
    PM
    null

  • Dimension table is larger than the fact table

    Hi Community,
    How can we explain the phenomenon when a dimension table has MORE records in it than the fact table ?  What are the conditions that would cause this to occur ?
    Thank you !
    Keith

    Thanks, Bhanu,
    I am wondering specifically how to explain the output from program SAP_INFOCUBE_DESIGNS when the dimension table is shown to have a fact table ratio that is greater than 100%
    I believe that SAP_INFOCUBE_DESIGNS already takes into consideration both the E and also the F-fact table when calculating the ratio.  So in this case, we could not explain it by your first suggestion (after compression - but looking at only the F table).
    In the case where selective deletions have been performed, how can we correct the situation ?  For example, how could we clean out the records in the dimension tables which no longer have any facts in the fact table ?  (I think the BW system should do this automatically as a part of the selective deletion, don't you agree ?).
    Also, is there any other explanation for how the dimension table could arrive at greater than 100% the size of the fact table(s) ?
    For example, lets say that (theoretically) we placed many very dynamic characteristics together into the same dimension.. which we know you should not do.  Would it be possible for the combination of these very many dynamic characteristics to cause so many DIM IDs that the dimension table overtakes the record count of the fact table ?  Is this situation then made worse by compression if the number of fact table records is reduced thanks to removal of the request ID ?

  • 3 confirmed Dimensions and 2 fact tables

    Hi experts,
    how can we connect 3 confirmed Dimensions and 2 fact tables without loops and traps please give me a solution

    Hi,
    Dimensions Tables : Dimension tables are typically small, ranging from a few to several thousand rows. Occasionally dimensions can grow fairly large, however. For example, a large credit card company could have a customer dimension with millions of rows. Dimension table structure is typically very lean, for example customer dimension could look like following:
        Customer_key
        Customer_full_name
        Customer_city
        Customer_state
        Customer_country
    Fact Tables :a fact table consists of the measurements, metrics or facts of a business process. It is often located at the centre of a star schema or a snowflake schema, surrounded by dimension tables.
    Fact tables contain keys to dimension tables as well as measurable facts that data analysts would want to examine. For example, a store selling automotive parts might have a fact table recording a sale of each item. The fact table of an educational entity could track credit hours awarded to students. A bakery could have a fact table that records manufacturing of various baked goods.
    Context Versus Alias Overview :
    http://www.dagira.com/2009/07/22/context-versus-alias-overview/
    How to create context :
    http://www.bidw.org/business-objects/universe-design/understanding-context-and-its-use-in-business-objects-universe/
    You can also look on the eFashion universe for more information.
    Thanks,
    Amit

  • Record count is more in the Fact tables when compared to Cube data!

    When i delete request from my cube it is not getting deleted from the fact table. Cube shows around 3.5 million records but when I checked in the fact table it was showing more than 11 million records.

    Hi Kingsley,
       You may try this approach.
       1. Use TCode listschema
       2. Select the type of cube abd give the cube name as well.
       3. This will display the table sinvolved in the cube(star schema).
       4. Select the Ftable listed there and see the number of rows in it.
       Inorder to delete the entire data from cube, you may need to delete all the load requests that has happened before as well.
       Hope this helps...
    Thanks,
    Raj

  • 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

  • Is it ok? if we have 42 million records in a single fact table!!

    Hello,
    We have three outstanding fact tables, and we need to add one more fact type, and we were thinking whether we can do two different fact tables, or can we put the values in one of the same fact table which is similar, but the records are upto 42 million if we add ,so my question is having a single fact table with all records, or breaking it down, to two different ones!!!Thnx!!

    I am not sure what is an "outstanding fact" or an "fact type". A 42m fact table doesn't necessarily indicate you are doing something wrong although it does sound as odd. I would expect most facts to be small as they should have aggregated measures to speed up report. In some cases you may want to drill down to the detailed transaction level in which case you may find these large facts. But care should be taken not to allow users to query on this fact without user the "transaction ID" which obviously should be indexed and should guarantee that queries will be quick.
    Guessing from your post (as it is not clear not descriptive enough) it would seem to imply that you are adding a new dimension to your fact and that will cause the fact to increase it's row count to 42m. That probably means that you are changing the granularity of the fact. That may or may not be correct, depending on your model.

  • Count of id's inside FACT TABLE

    hi,
    I will like to calculate the count of particular id inside a FACT table.
    How to get this done in AWSM or Discoverer For OLAP.
    Thanks, Prasad

    There is a tech note in the May 05 OLAP Newsletter that explains how to do this:
    http://www.oracle.com/technology/products/bi/olap/oracleorpnewsletter_may05.htm
    However, there is a bug/"enhancement opportunity" with the aggregation engine which means the wrong results can be returned. To resolve this you need to run some additional DML after you have created the measure to force the aggregation engine to respect the order of the dimensions set within the Rules tab. The order of the dimensions in this tab is important as it controls when the MAX() vs SUM() aggregation methods are applied.
    On the variable that supports the logical formula assign the following property by issuing the following statement:
    cns YOUR_VARIABLE_NAME
    PROPERTY '$AGGREGATE_FORCEORDER'
    and on the logical formula update the definition by also adding a FORCEORDER statement. For example a modified formula would look as follows:
    consider EXPENSE_PRT_TOPFRML
    eq aggregate(this_aw!EXPENSE_PRT_TOPVAR using this_aw!OBJ311101508 FORCEORDER)
    compile EXPENSE_PRT_TOPFRML
    upd
    commit
    Obviously, if you delete the cube and rebuild it from an XML template or redefine it manually you will have to reapply these changes again.
    Hope this helps
    Keith Laker
    Oracle EMEA Consulting
    BI Blog: http://oraclebi.blogspot.com/
    DM Blog: http://oracledmt.blogspot.com/
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    BI Samples: http://www.oracle.com/technology/products/bi/samples/

  • How to handle 3 different fact tables and measures within a DAX query?

    I am writing a DAX query in DAX studio in Excel against a tabular model that has 4 different Fact tables, but they share the same dimensions. (There's some long story I can't get into here, but unfortunately this is the structure) I want to
    include measures from the 4 fact tables, summarize by the dimensions in a single query output that can be used for a pivot table.  So far I have something like this:
     EVALUATE
    FILTER
        SUMMARIZE
            FactTable1,
            DimensionTable1[Value],        DimensionTable2[Value],
            DimensionTable3[Value],
            Dimensiontable4[Value],
            'dimDateTime'[Month PST],
            DimDateTIme[FiscalYear PST],
            "Measure Score",
            FactTable1[Measure 1],
            "Measure Score 2",
            FactTable1[Measure 2],
        ,Company[CompanyName]="Company ABC" 
    What I want to do is summarize the 3 fact tables by the same dimensions, but I am not sure how to do that within a DAX query.  I am getting an error if I try to include another table statement in the original SUMMARIZE function, even though the FACTS
    do share the same dimension.  Is there an easy way to do this?

    You can use ADDCOLUMNS to add the data from other tables, but you need to use within the SUMMARIZE the fact table that determines the cardinality of the output. If you are not sure (e.g. you project cost and revenues from two fact tables by month and there
    could me months with cost and no revenues, but also months with revenues and no costs), then you should use CROSSJOIN and then FILTER.
    You query might be written as (please note CALCULATETABLE instead of FILTER to improve performance):
    EVALUATE
    CALCULATETABLE (
        ADDCOLUMNS (
            SUMMARIZE (
                FactTable1,
                DimensionTable1[Value],
                DimensionTable2[Value],
                DimensionTable3[Value],
                Dimensiontable4[Value],
                'dimDateTime'[Month PST],
                DimDateTIme[FiscalYear PST]
            "Measure Score", FactTable1[Measure 1],
            "Measure Score 2", FactTable1[Measure 2]
        Company[CompanyName] = "Company ABC"
    Marco Russo http://www.sqlbi.com http://www.powerpivotworkshop.com http://sqlblog.com/blogs/marco_russo

  • Counting number of records using where clause in a large table

    SQL SERVER 2008
    I've to find the count of the rows matching some conditions. The table size is very large with around 50 columns. And every day around 3000 rows are adding. 
    My business logic is to count the number of payments made by a particular user, also if the count exceeds 10 then the user is GoldUser else NormalUser.
    here:
    select count(payment_id) from payments_master_table where payment_user = @payment_user;
    here payment_id is primary key. This query is very slow, since it has to scan the whole table. Is there any other optimized way to find the number of counts. 
    Also, one way I can do is, if the count of payment_id exceeds 10, stop the count,
    but I do not how to do this.  
    Please can anyone help me. 
    Thanks!

    not top 10, but suppose 
    if the count(payment_id) reached 10 for a particular user before scanning the whole
    table, why to proceed ahead. My condition is to apply any user as GoldUser if the count is 10 or more than that. So stop the count if it reaches 10.
    Then in that case you need to implement it as a correlated query
    ie like
    SELECT t.User,COUNT(*)
    FROM table t
    CROSS APPLY (SELECT TOP 10 payment_id
    FROM table
    WHERE payment_user = t.payment_user
    )t1
    GROUP BY t.User
    It will try to fetch random 10 rows for the user and then get count. But even in this case you cant tell it will stop at exactly 10 record for every user as it depends on few other factors too.
    In any case the index on the payment_user column will really help
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Select count from large fact tables with bitmap indexes on them

    Hi..
    I have several large fact tables with bitmap indexes on them, and when I do a select count from these tables, I get a different result than when I do a select count, column one from the table, group by column one. I don't have any null values in these columns. Is there a patch or a one-off that can rectify this.
    Thx

    You may have corruption in the index if the queries ...
    Select /*+ full(t) */ count(*) from my_table t
    ... and ...
    Select /*+ index_combine(t my_index) */ count(*) from my_table t;
    ... give different results.
    Look at metalink for patches, and in the meantime drop-and-recreate the indexes or make them unusable then rebuild them.

  • Duplicate records in Fact Tables

    Hi,
    We are using BPC 7.0 MS SP7. BPC created duplicate records in WB and Fac2 tables. We faced similar issue before and the solution was to reboot the server and cleanup the additional data created. I think it should not be an issue with the script logic files we have. We had the issue across all applications. Data is fine now after the server reboot and running the same logic files.  I want to know if any one faced this issue and if there is any solution other than reboot. I appreciate your help.
    Thanks
    Raj

    Hi Sorin,
    I know this thread is rather old, but i have a problem which is pretty much related to this thread and appreciate if you could assist me. I have client running on 7.0 MS who has been using it for the past 3 years.
    It is a heavily customized system with many batch files running daily to update dimensions, copy data and sort. And Yes we do use custom packages that incorporates stored procedures.
    Recently, with no change in environment, we encountered our factwb ballooning up out of no where. fact table only contains less then 1 gb data but, factwb has 200 gb data and practically paralayzed the system. There is also equilavent 300 gb increase in the log files.
    We are not able to find out what caused this? Or if even the 200gb records in wb are even valid records that are duplicated. Is there a way to troubleshoot this?

  • Distinct count for multiple fact tables in the same cube

    I'm fairly new to working with SSAS, but have been working with DW environments for many years.
    I have a cube which has 4 fact tables.  The central fact table is Encounter and then I also have Visit, Procedure and Medication.  Visit, Procedure and Medication all join to Encounter on Encounter Key.  The relationship between Encounter
    and Procedure and Encounter and Medication are both an optional 1 to 1.  The relationship between Encounter and Visit is an optional 1 to many.
    Each of the fact tables join to the Patient dimension on the Patient Key.  The users are looking for a distinct count of patients in all 4 fact tables.  
    What is the best way to accomplish this so that my cube does not talk all day to process?  Please let me know if you need any more information about my cube in order to answer this.
    Thanks for the help,
    Andy

    Hi Andy,
    Each distinct count measure cause an ORDER BY clause in the SELECT sent to the relational data source during processing. In SSAS 2005 or later, it creates a new measure group for each distinct count measure(it's a technique strategy for improving perormance).
    Besides, please take a look at the following distinct count optimization techniques:
    Create Customized Aggregations
    Define a Processing Plan
    Create Partitions of Equal Size
    Use Partitions Comprised of a Distinct Range of Integers
    Distribute the Hash of Your UserIDs
    Modulo Function
    Hash Function
    Choose a Partitioning Strategy
    For more detail information, please refer to the article below:
    Analysis Services Distinct Count Optimization:
    http://www.microsoft.com/en-us/download/details.aspx?id=891
    In addition, here is a good article about SSAS Best Practices for your reference:
    http://technet.microsoft.com/en-us/library/cc966525.aspx
    If you have any feedback on our support, please click
    here.
    Hope this helps.
    Elvis Long
    TechNet Community Support

  • Count number of records in a internal table

    hi
    i want to count number of records in internal table
    pls let me know how to count the number of records in a internal table.
    regards
    Arora

    hi
    one way is
    data field type i.
    Decribe table itab lines field.
    write: / field.
    displays the no of records in tha internal table
    or if u want to write logic.
    data:
      w_count type i.
    loop at itab.
    w_count = w_count + 1.
    endloop.
    write: / w_count.
    displays the no of records.
    reward points if useful.

Maybe you are looking for

  • My cd/dvd drive does not accept any cds/dvds

    I know this has been posted before, but I have tried many methods posted on this site and others, and either I have done them wrong or they haven't worked. I have a three year old macbook pro running 10.6.8. I also have Windows 7 Ultimate running on

  • Program ID   in Sender RFC adapter.

    Hi Experts,   I have created 9 interfaces between same R3 (RFC Sender)  and FTP (file receiver)server. , Do i need to  create 9 RFC sender communication channels with different program ID (for registered server program in RFC destination type TCP/IP

  • Grants vs Projects

    I am currently involved in an r12 reimplementation for a HEI that uses the Oracle Grants module, and we are proposing to move to a totally project centric model for the accounting. However, there appears to be much confusion as to whether Grants and

  • IND CS4: Bug with "On Next Odd Page"

    Hi - I'm seeing something strange in my doc. I have the title of my document styled to start "On Next Odd Page". If I make the title (which is in a text var) more than the width of the page, my entire 25 page doc goes blank. It appears that everythin

  • I'm not a File Server tech-iCal Server setup decision? Was using NUTD

    I've read thru the iCal Server Admin pdf multiple times. There is a ton of server related knowledge required to successfully set iCal Server up. I don't have it (the knowledge) and don't have time to dedicate to learning it. My company used to use No