I have a supertype dimension and subtype dimension data stored in same table.
I have a column in the table dimtype which is set to the id of subtype or supertype.
I would like to report data for supertype or subtype separately.
How can I do this through cognos or SSAS.
In cogonos I found a way where I can create filters. (Is this a good idea of using filters in cognos?)
But in ssas I dunno where I can create this type of filters.
Can any of you please suggest how to set filters on dimensions on ssas?
If I am using different tables for each supertype or subtype it works fine but customer has subtype, supertype data in same table which is causing problem while reporting.
Related
I am new to SSAS and am setting up a proof of concept. I love the idea of Role-Playing dimensions, but i'm having trouble getting one setup that is NOT based on dates. Here is the use-case:
In our ERP system, we have a fact table we'll call "Time Entries" that has:
User_ID
Biller_ID
Approver_ID
Hours Worked
ETC
I also have a "Resource" table that i'm relating these to as foreign keys:
Resource_ID
Department_Name
ETC
When I create my Data Source View, I create a relationship between:
User_ID -> Resource_ID
Biller_ID -> Resource_ID
Approver_ID -> Resource_ID
My "Resource" Dimension can be successfully deployed and processed, and has the following Attributes:
Resource_ID
Department Name
My "Work Entries" cube has one measure, "Hours Worked". When I add in my "Resources" dimension, it creates three roleplaying dimensions:
User
Approver Resource
Biller Resource
When I go to process, i'm receiving the following error:
Errors in the OLAP Storage Engine: The attribute key cannot be found when processing: Table: 'Time Entries', Column: 'user_id', Value: 'some number', The Attribute is 'Resource ID'.
So far, the only post I've followed that allowed me to successfully troubleshoot is this one:
https://www.sqlservercentral.com/Forums/1219713/Errors-in-the-OLAP-storage-engine-The-attribute-key-cannot-be-found-when-processing-Even-though-key-Exist-in-Dim-Table
TL;DR -
I've delete the relations between the factable and dim tables in the database.
I refresh the dataSourceViews and thera are no relations between tables
I remove the dimentions in the cube design
I recreate the dimentions in the cube design
I build then relations in the dataSourceViews between the foreign key in the factable and the primary keys in dim tables
i reprocesed the cube
The problem with this is that because we've added the dimension back BEFORE creating the relationships, we don't have our roleplaying dimensions.
I feel like i'm missing something simple here, but I can't quite figure it out. Can anyone tell me why my roleplaying dimensions aren't working?
Roleplaying function of a dimension does not depend on its type. Your dimensions can be used in role-playing scenario like Date dimension.
On your problem - SSAS engine might build sometimes strange queries extracting dimension data, especially when your dimension is based on data from several tables. To check and investigate it:
Fix user_id value from your error message
Do process update or process full on corresponding dimension, and get SQL query used for processing user_id attribute from processing window form. It is under processing user_id attribute log entry.
Copy SQL query and run it. Check whether it returns id from the error message above.
If the value is missing - investigate the query
In my experience - such things occurred when an erroneous dimension was built on two tables with some relation. SSAS engine have built query with strict inner join, and it has to be less restrictive left outer join.
You can fix it with SSDT playing with DSV attribute being non-empty, but I found more simple to write a SQL query with proper joins in DSV directly.
I am new to the BI realm so forgive me for any mistakes in my understanding. I am designing a Cube using Pentaho with Saiku and have created a basic star schema to support it. My fact table consists of a few facts which are numerical values representing hours of work and cost of work and surrogate keys to the dimension tables.
I need to be able to perform sorting, filtering and querying on several dates related to my fact records. I have created a date dimension to accomplish this. The problem I am having is relating my fact table to this dimension multiple times. Using Schema Workbench I managed to create multiple DimensionUsage records for each of my surrogate keys with different names each pointing to my date dimension.
Upon importing this Mondrian file back into Pentaho and creating a new Saiku Query I am presented with my list of measures and the related dimensions. The issue is that all my references to my date dimension are named the same, the name of the dimension table rather than the name I specified in Schema Workbench. I am unable to tell which relation is for which date field. Any ideas of where I may have gone wrong or is this a limitation of the products I am using?
I am using Pentaho CE 7.1
I have three tables, one fact and two dimensions. I want to make a referenced relationship between the fact table(measures) called InternetSales and the Geography table, se image(schemaCubeStructure".
The intermediate table is Customer. I first create the Geography and InternetSales tables and then the Customer with a field from Geography to use later when creating the ref. rel.
Everything works fine until browsing the data in the cube (se image "errorBrowseSalesCube". If i don´t make the relationship between the two tables i get image "correctBrowseSalesCube" which is what i want. That is i don´t get any data when processing with the rel.ref.
See image "dimensionUsageSalesCube for rel.ref.
Why is that i don´t get any data?
correctBrowseSalesCube
errorBrowseSalesCube
dimensionUsageSalesCube
schemaCubeStructure
What fields did you use when setting up your reference dimension relationship between Georgaphy and Internet Sales?
The in the AdventureWorksDW database, the Georgaphy dimension is a snowflake off of Customer dimension. In the AdvWrks cube project, Microsoft includes the geography table and corresponding attributes in the customer ssas dimension (red boxes in screenshot below). However, they could have, as it looks like you are trying to do, simply added the GeographyKey to the customer dimension (red arrow in screenshot below)
This exposes the GeorgaphyKey field when creating the reference dimension relationship so that you can properly define the relationship between the intermediate dimension (customer) and the reference dimension (geography):
After that, you can properly browse the Internet Sales facts by Georgraphy dimension attribute (and user) hierarchies:
The correctBrowse sales cube can be easily explained. It means that the data is not calculated based on the Geography dimension and thus indicates that the connection between the Internet sales and the Geography is not correctly calculated.
I would suggest the following:
Try making the customer a Mesaure (or fact table). Do not rename it just make a measure i.e. the count of customers (can be used as a counter of customers/per region or can be invisible altogether).
Then The customer will appear as a measure in Dimension usage and then connect Geography to Internet sales via a many to many relation Using the customer measure table.
I was hoping someone could explain the appropriate use of the 'FACT Relationship Type' under the Dimension Usage tab. Is it simply to create a dimension out of your fact table to access attribute on the fact table itself?
Thanks in advance!
Yes, if your fact table has attributes that you would like to slice by (create a dimension from), you would use this relationship type.
Functionally, to the users it behaves no differently than a regular relationship.
After you create your dimensions and cubes you need to define how each dimension is related to each measure group. A measure group is a set of measures exposed by a single fact table.
Each cube can contain multiple fact tables and multiple dimensions. However, not every dimension will be related to every fact table.
To define relationships right click the cube in BIDS and choose open; then navigate to the Dimension Usage tab. If you click the ellipsis button next to each dimension you will see a screen that allows you to change dimension usage for a particular measure group. You can choose from the following options:
Regular default option; the dimension is joined directly to the fact table
No relationship the dimension is not related to the current measure group
Fact the dimension and fact are derived from a single table. If this is the case your dimensional warehouse has poor design and isn't likely to perform well. Consider separating fact and dimension tables.
Referenced the dimension is joined to an intermediate table prior to being joined to the fact table. Referenced relationship resembles a snowflake dimension, but is slightly different. Suppose you have a customer dimension and a sales fact; you'd like to examine total sales by customer, but you also want to examine line item sales by customer. Instead of duplicating the customer key in the line item fact table you can treat the sales fact as an intermediate table to join customer to line item.
Many-to-many this option involves two fact tables and two dimension tables. Dimension A is joined to an intermediate fact A, which in turn joins to dimension B to which the fact B is joined. Much like with fact option if you need to use many-to-many option your design could probably use some improvement. This type of relationship is sometimes necessary if you are building cubes on top of a relational database that is in 3rd normal form. It is strongly advisable to use a dimensional model with star schema for all cubes. For example you could have two fact tables: vehicles and options; each vehicle can come with a number of options. You're likely to examine vehicle sales by customer, and options by the items that are included in each option. Therefore you would have a customer dimension and item dimension. You could also want to examine vehicles sales by included item. If so the vehicle fact would be joined to the options fact and customer dimension; the options fact would also join to items' dimension.
Data mining target dimension is based on a mining model which is built from a source dimension. Both source dimension and target dimension must be included in the cube.
Why is it not necessary to define a hierarchy using the Date attribute from a date/time table?
The Analysis Service project seems to want me to create a hierarchy within my Dimension -- the tooltip says "Create hierarchies in non-parent child dimensions". I really had none that came to mind, so I tried adding a the PK Date attribute from my Time table, and creating a hierarchy with that.
When I do this, I get the error "Errors in the high-level relational engine. The 'dbo_Orders' table that is required for a join cannot be reached based on the relationships in the data source view."
I noticed in the AdventureWorks sample never uses Date in a hierarchy. Why is this?