Count key links to dimension

Hi all,
I have a fact table with a lot of production checks. The checks are all dimension tables with value 0 (rejected) and 1 (pass). For the moment I'm only interested in the rejects.
FactProduction: Factkey, LineNrKey, DateKey, Check1Key, Check2Key, ...Check30key, Weight
DimCheck1 , DimCheck2, ...
Fact table:
Factkey; LineNrKey; DateKey; Check1Key; Check2Key; ...;Check30key; Weight
1; 2;
20150102; 0; 1; ...; 1;   0,250
1; 2;
20150102; 1; 0; ...; 0;   0,253
1; 2;
20150102; 0; 1; ...; 1;   0,248
Result should be:
columns: Weight/FactProductionCount/Check1Reject/Check2Reject/Check3Reject 
row Product1 10658/7450/30/18/22
Product2 7856/5000/25/3/10
What's the best way to achieve this?

Hi SSAS_first_user,
According to your description, you want to count the rejects("0") for each type of check. Right?
In this scenario, we can apply IIF() condition in a custom measure to give value 1 for each reject("0"), then it can be aggregated into total when using in MDX query. Based on your result sample, you supposed to have a product dimension in your
cube. Please refer to a sample query below:
WITH MEMBER MEASURES.Check1Count AS
IIF([Measures].[Check1Key]=0
, 1, 0)
SELECT MEASURES.Check1Count ON 0,
[Product].[Product].MEMBERS ON 1
FROM [Adventure Works]
WHERE
[DimCheck1].[Check1].&[0]
Reference:
IIf (MDX)
Best Regards,
Simon Hou
TechNet Community Support

Similar Messages

  • The table name or tcode to count the number of Dimensions and Key Figures

    Hi all,
    Do you have an idea about the table name or tcode to count the number of Dimensions and Key Figures of an Infocube WITHOUT installing the cube from Business Content?
    Thanks in adv.
    Ajay

    Hi,
    You can't do that because there's no active table in the system for the Business Content since it hasn't been installed yet...
    One thing you could do is go to the Business Content Tab, select "Infoproviders by InfoArea" on the left side, look for the Cube or DSO you want to check, right click on it and select "Display Description".
    On the window that opens you'll have a list of all InfoObjects and Key Figures. You also have the option to Display it as Start Schema, where you can see the Dimensions, etc.
    Hope this helps.
    Luis

  • Keyboard malfunction - keys link to others

    Recently my MBA started having keyboard issues where 1 key links to another. Nothing out of the usual has happened nor have I spilled anything on my macbook. The keys that are linked are F7-F8, 7-8, U-I, J-K, M-,  So they seem to be just beside each other in the same area. Has anyone ran into this problem? I'm very confident that I did not spill any liquid on this and think it may be a hardware malfunction.
    Please help with any tips or solutions.
    - Aquious

    Hi there aquious,
    You may find the troubleshooting steps in the article below helpful.
    One or more keys on the keyboard do not respond
    http://support.apple.com/kb/ts1381
    -Griff W. 

  • Loading Parent Keys in Customer Dimension

    I have a question about how to setup my mapping for my Customer Dimension. A subset of the dimension attributes is below:
    Customer_Key (Surrogate Key)
    Customer_Number
    Parent_Key
    Bill_To_Key
    My source table has the following fields:
    Customer_Number
    Bill_to_Customer_number
    Parent_Customer_number
    I am having difficulty in visualizing this because I can see where the current record may be for customer 10 and its parent is customer 20. Since I have not loaded the record for customer 20, I cannot use a lookup to get the surrogate key for customer 20 as it does not exist. So, my only thought was to load the dimension without the parent and bill_to keys and then run a post-mapping process to update the missing fields. This works, but takes an extremely long time (4 hours) as there are over 300,000 records that it has to update. Maybe my post-mapping process was just inefficient, I am not sure. What I am doing is running an update command on my dimension and looking up the customer-numbers from my staging table, then looking up the surrogate key in my dimension.
    Is there a better, more efficient, way to do this?
    Thanks,
    Jason

    I did a little more work with this and have developed at procedure in the post-mapping process that updates the necessary fields in about 3-4 seconds.
    Sorry for taking up extra room in the OWB forum with a sql efficiency issue.
    Thanks,
    Jason

  • How we use Surrogate Keys for snowflake dimension

    Hi All,
    my question is - How we use  Surrogate Keys for  snowflake dimension
    i heard from some body Surrogate Keys only work with star schema.
    please correct me if i wrong.
    Regards,
    Manish

    Hi manishcal16PPS,
    According to your description, you can only create natural key in your dimension. But it's not working when using surrogate key. Right?
    In Analysis Services, the snowflake schema of the dimensions are represented by more than one dimension table in other words its takes multiple dimension tables to define a dimension. Surrogate key are just some extra, redundant, unique key based on the
    natural key. So there's no direct relationship or some limitations between surrogate keys and snowflake schema.
    In this scenario, since there's relationship between the two dimensions, you should create natural key. For using natural key or surrogate key. Please refer to an article below:
    Surrogate Key vs. Natural Key
    For understanding star/snowflake schema, please see:
    Understanding Star and Snowflake Schemas 
    Regards,
    Simon Hou
    TechNet Community Support

  • Is there a technology that can trace and count a link ?

    Is there a technology that can trace and count a link ?
    For Example ,how can I trace links and calculate how many times have they been clicked in CNN News ?
    Or how can I calculate  which link  is the top link clicked by people all over the world ?  I need this .

    lovat wrote:BTW HOW  does google news select its news ? Don't they choose the most clicked ones ? There must be a method .At least  google can do this .
    First, there's no way to trace how many links are "clicked" world wide (maybe there's an ancient alien race which has the technology, but we haven't met them yet ).  You can do that for single web sites though.
    The following is very simplified because I think Google uses some complex algorithms to calculate the relevance/importance of certain pages and for example their appearance in the Google News, page rank, position in search queries etc:
    Google spiders the web and checks how pages link to each other by scanning the content of the spidered webpage. For example the more external pages link to a certain news item are found, the higher is its relevance. The "credibility" of these external sites probably has also an impact on how Google calculates the "relevance" of a site. For example if the New York Times links to an article, this link "weights" more than a link from any other random web page. I also believe that news sites are spidered way more often and in shorter intervals than the rest of the web to make services like Google News possible.

  • Linking one dimension to another

    I have this scenario:
    Entity     Profit Center     Cost Center
    E1     PC1     CC1
         PC2     CC2
    E2     PC3     CC3
         PC4     CC4
    E3     PC5     CC5
         PC6     CC6
    Entity, Profit Center and Cost Center are different dimensions in my model.
    But from business perspective, they are related: CC1 is related to PC1, CC2 is related to PC2 and PC1 and PC2 are related to E1 (Entity). Same for others as shown above.
    The requirement is when a user selects and Entity lets say E1, Profit Center and Cost Center should be automatically populated as above.
    When a user selects Entity E2, it should show him PC3 and PC4 and CC3 and CC4.
    How do we link these dimensions together?
    Thanks.

    Hi Anand,
    Please try the below:
    Lets say that the user is entering the entity in the cell B5, then your PC memberset should like
    ="ENTITY='"&$B$5&"'"
    Here, ENTITY is the property name of the PC dimension.
    Hope this helps.

  • Invalid leaf record count, keys out of order?

    Yesterday I returned home from a month long trip which I did not bring my 13 inch 2011MacBook Pro on.
    I plugged it in and turned it on, and connected my phone to it so i could retrieve some photos. I looked away and looked back to see the grey  "You must hard shut down your computer" error message. Possibly because i think the phone may have been disconnected without being properly ejected? So i turned it off and then later the next day, when I try to turn it on it is stuck on the white apple loading screen forever. When I startup with Command+R and enter disk utility, it tells me:
    Invalid Leaf record count, keys out of order, volume could not be repaired. When I startup in single user mode and use fsck -fy it tells me the same.
    I got it used less than a year ago. I have some pretty heavy applications like MS Office, Photoshop and a few other adobe applications, and The Sims 3.
    Help!

    When Disk Utility can't repair a hard drive, with an error like that, many buy Disk Warrior to do the repair. You can see an answer on the Disk Warrior site here.
    Or, if you have a system backup, erase the hard drive (I would probably do a secure erase and write zero's to the hard drive) and restore it.

  • I need a field like "System.RelatedLinkCount" but where the count is linked items with a field in a certain state

    I need a field like "System.RelatedLinkCount" but where the count is linked items with a field in a certain state.
    e.g. I've got a WI with a field on it that tells me how many active bugs are linked to it. (I'm not actually counting active bugs, but hopefully you get the idea). 
    The only way I can think to do this is with a TFS plugin and catching the workitemchanged event. I'd prefer to do this entirely in the WI if possible? is there a way to do this? Thanks

    Hi TimB33, 
    Thanks for your post.
    As far as I know there’s no default WI rule support to get the specific WIT linked count, I think you need to create your custom work item control to achieve that if you want this field.
    For this scenario, please submit it to User Voice site at: http://visualstudio.uservoice.com/forums/121579-visual-studio. Microsoft engineers will evaluate them
    seriously.  
    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.

  • Counter Key Figure

    Hi
    I have created a counter key figure for my Cube and assigned constant 1 in the transformations.
    The thing is I am seeing Key figure value =2 in cube and not = 1 for each row .
    I checked the PSA and I see that 2 rows of each set of unique data . So I am not able to figure out why there are 2 rows for each unique data with only different Datarecord number.
    and How to define the counter Key Figure.
    Thanks in advance.

    Hi,
    It sounds like you defined your counter correctly, but it also sounds like you are getting doubled data coming in.  Look at your source and figure out why you are getting doubled data.
    On the converse, you can go into your query and create a global calculated key figure on the counter variable.  After you do this, in the properties section of the calculated key figure ... choose the enhance button at the bottom and choose summation for aggregation and exception aggregation of Count all values <> 0 for a characteristic that makes sense.
    Brian

  • SSRS report with tabular model – MDX query how to get the sum and count of measure and dimension respectively.

    Hello everyone,
    I am using the following MDX query on one of my SSRS report.
    SELECT NON EMPTY { [Measures].[Days Outstanding], [Measures].[Amt] } ON COLUMNS,
    NON EMPTY { ([Customer].[Customer].[Customer Key].ALLMEMBERS) }
    HAVING [Measures].[ Days Outstanding] > 60
    DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
    FROM ( SELECT ( STRTOSET(@Location, CONSTRAINED)) ON COLUMNS
    FROM ( SELECT ( {[Date].[Fiscal Period].&[2014-06]}) ON COLUMNS
    FROM [Model]))
    Over here, the data is being filtered always for current month and for a location that is being selected by user from a report selection parameter.
    I would like to get the count of total no. of customers and sum of the amount measure.
    When I am using them in calculated members it gives incorrect values. It considers all records (ignores the sub-select statements) instead of only the records of current month and selected location.
    I also tried with EXISTING keyword in calculated members but there is not difference in output. Finally, I manage the same at SSRS level.
    Can anybody please advise what are the ways to get the required sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension?
    Also, does it make any difference if I manage it as SSRS level and not at MDX query level?
    Any help would be much appreciated.
    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

    Can anybody please advise what are the ways to get the required sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension?
    Also, does it make any difference if I manage it as SSRS level and not at MDX query level?
    Hi Ankit,
    We can use SUM function and COUNT function to sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension. Here is a sample query for you reference.
    WITH MEMBER [measures].[SumValue] AS
    SUM([Customer].[Customer].ALLMEMBERS,[Measures].[Internet Sales Amount])
    MEMBER [measures].[CountValue] AS
    COUNT([Customer].[Customer].ALLMEMBERS)
    MEMBER [Measures].[DimensionName] AS [Customer].NAME
    SELECT {[Measures].[DimensionName],[measures].[SumValue],[measures].[CountValue]} ON 0
    FROM [Adventure Works]
    Besides, you ask that does it make any difference if I manage it as SSRS level and not at MDX query level. I don't thinks it will make much difference. The total time to generate a reporting server report (RDL) can be divided into 3 elements:Time to retrieve
    the data (TimeDataRetrieval);Time to process the report (TimeProcessing);Time to render the report (TimeRendering). If you manage it on MDX query level, then the TimeDataRetrieval might a little longer. If you manage it on report level, then the TimeProcessing
    or TimeRendering time might a little longer. You can test it on you report with following query: 
    SELECT Itempath, TimeStart,TimeDataRetrieval + TimeProcessing + TimeRendering as [total time],
    TimeDataRetrieval, TimeProcessing, TimeRendering, ByteCount, [RowCount],Source
    FROM ExecutionLog3
    WHERE itempath like '%reportname'
    Regards,
    Charlie Liao
    TechNet Community Support

  • Keys in a Dimension Level

    Hi,
    I am creating a Dimension with two levels.
    As every level must have two identifiers: a surrogate identifier and a business identifier.
    when I create the dimension, i can define surrogate key for the first level as well as business identifier. But for the second level I am able only to define the business identifier and am not getting the option of surrogate identifier.
    Please, guide me.
    I am using OWB 11G on windows XP.
    thanks in advance

    You may have more luck getting an answer to this question on the Warehouse Builder forum. I am not aware of any difference in the handling of levels at the AW level. You could also consider using AWM to define your AW, since this would let you take advantage of the new features in 11g. (I believe OWB support is currently limited to 10g style AWs in an 11g instance.)
    Link: Warehouse Builder

  • 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

  • Foreign keys in SCD2 dimensions and fact tables in data warehouse

    Hello.
    I have datawarehouse in snowflake schema. All dimensions are SCD2, the columns are like that:
    ID (PK) SID NAME ... START_DATE END_DATE IS_ACTUAL
    1 1 XXX 01.01.2000 01.01.2002 0
    2 1 YYX 02.01.2002 01.01.2004 1
    3 2 SYX 02.01.2002 1
    4 3 AYX 02.01.2002 01.01.2004 0
    5 3 YYZ 02.01.2004 1
    On this table there are relations from other dimension and fact table.
    Need I create foreign keys for relation?
    And if I do, on what columns? SID (serial ID) is not unique. If I create on ID, I have to get SID and actual row in any query.

    >
    I have datawarehouse in snowflake schema. All dimensions are SCD2, the columns are like that:
    ID (PK) SID NAME ... START_DATE END_DATE IS_ACTUAL
    1 1 XXX 01.01.2000 01.01.2002 0
    2 1 YYX 02.01.2002 01.01.2004 1
    3 2 SYX 02.01.2002 1
    4 3 AYX 02.01.2002 01.01.2004 0
    5 3 YYZ 02.01.2004 1
    On this table there are relations from other dimension and fact table.
    Need I create foreign keys for relation?
    >
    Are you still designing your system? Why did you choose NOT to use a Star schema? Star schema's are simpler and have some performance benefits over snowflakes. Although there may be some data redundancy that is usually not an issue for data warehouse systems since any DML is usually well-managed and normalization is often sacrificed for better performance.
    Only YOU can determine what foreign keys you need. Generally you will create foreign keys between any child table and its parent table and those need to be created on a primary key or unique key value.
    >
    And if I do, on what columns? SID (serial ID) is not unique. If I create on ID, I have to get SID and actual row in any query.
    >
    I have no idea what that means. There isn't any way to tell from just the DDL for one dimension table that you provided.
    It is not clear if you are saying that your fact table will have a direct relationship to the star-flake dimension tables or only link to them through the top-level dimensions.
    Some types of snowflakes do nothing more than normalize a dimension table to eliminate redundancy. For those types the dimension table is, in a sense, a 'mini' fact table and the other normalized tables become its children. The fact table only has a relation to the main dimension table; any data needed from the dimensions 'child' tables is obtained by joining them to their 'parent'.
    Other snowflake types have the main fact table having relations to one or more of the dimensions 'child' tables. That complicates the maintenance of the fact table since any change to the dimension 'child' table impacts the fact table also. It is not recommended to use that type of snowflake.
    See the 'Snowflake Schemas' section of the Data Warehousing Guide
    http://docs.oracle.com/cd/B28359_01/server.111/b28313/schemas.htm
    >
    Snowflake Schemas
    The snowflake schema is a more complex data warehouse model than a star schema, and is a type of star schema. It is called a snowflake schema because the diagram of the schema resembles a snowflake.
    Snowflake schemas normalize dimensions to eliminate redundancy. That is, the dimension data has been grouped into multiple tables instead of one large table. For example, a product dimension table in a star schema might be normalized into a products table, a product_category table, and a product_manufacturer table in a snowflake schema. While this saves space, it increases the number of dimension tables and requires more foreign key joins. The result is more complex queries and reduced query performance. Figure 19-3 presents a graphical representation of a snowflake schema.

  • OBIEE-can we link two dimension tables belonging to different fact tables?

    Hi ,
    I have just started with OBIEE concepts....need your views on this issue:
    Fact 1 -> Dim 1, Dim2,Dim3 and so on..
    Fact 2 -> Dim a, Dim b,Dimc and so on...
    If I link Dim1 and Dim a with a valid key ,would that distort the star schemas to slowflake in BMM layer?
    Thanks in advance!
    Neha

    I don't see this that would make it snowflake more like what I think as conforming dimensions. You need to make sure the grain of the measures is at what level , the they are same grain then you should be good however if they are different then you would start seeing null values.
    Fact Measures use the same, conformed dimensions like Dim1 and Dim a if you trying to generate from multiple facts, the BI server was able to automatically stitch them together into a single result set. If they came from the same fact table that's easy as its only one single table, but if you are pulling from different fact tables, the conformed dimensions would allow them to be stitched into the same report
    Conformance means that these sources can be mapped to a common structure – the same levels – and also the same data members.
    Mark if helps.
    Thanks,
    SVS

Maybe you are looking for