I am in the process of building my first tabular view and have a question.
The tabular model I have has 3 tables based on 3 views that exist on SQL server. An incident view, a users view and a category view.
On the incident view, I have 2 columns (AssignedUser,CreatedUser) which both can be linked to the users view based on user ID, however I have been told only one relationship between tables can be active at one time? If this is the case how would I link both assigned and created user back to the user table?
Sorry if it's simple to answer, I couldn't find anything helpful on google and I have tried!
Many thanks
If you need to join 2 times (or more) your Dimension User, you could duplicate your existing view.
for example:
Your DimUser view will be DimUserInCharge (Or DimSupportTeam, ..) and DimEndUser (or DimClient, ..)
Here is a small exeample based on Adventure Works DB
If you want to keep the same dimension, you will have to design your Fact in a different way. (And maybe add another dimension like "DimUserType")
or Add 2 differents Fact table
...
Does it help you?
Arnaud
Related
I need to create a tabular model with ssas but in a fact table I have two relations with the same dimension (time).
How is it best to handle this?
Duplicating the dimensions table ?
Thanks
You don't need to duplicate the dimension table. You can create both relationships, setting one as INACTIVE. Once this relationship is set up you can invoke the inactive relationship using the USERELATIONSHIP function. This will essentially make the relationship ACTIVE for that measure.
The following links give a great explanation followed by some examples.
Link 1
Link 2
Thanks for your answer,
this model is going to be used by business user and the haven't deep knowledge of dax.
I can't develop all the measures several times (also because it is about 4 dates per table and about fifty measures).
Whant do you think about this:
https://www.biinsight.com/role-playing-dimension-ssas-tabular/#more-1068
Thanks
I'm new to that topic. I've got a database with a flat fact table, which contain data like date, product group, product subgroup, product actual name, and some calculations/statistics. All I need to do is create a report using olap cube. I have got two ideas how to create that, but dont know which draft is better (if even correct). The original DAILY_REPORT... table has not a primary key. Its just a data table. In first concept I have created every table (which will be as a dimension) with a ID, and connected the product->family of product->project->building in a hierarchy. Another concept is without all ID's and hierarchy. Relation created automatically based on names. Can somebody explain me in which direction I should tend...?
First idea:
http://imgur.com/iKNfAXF
Second:
http://imgur.com/IZjW1W6
Thanks in advance!
You can follow these steps to create your cube:
Create a separate view for each of the dimensions you want to have. Group similar type of data in one view, for e.g. Product Name, Product Group, Product Sub-Group, etc.
Keep the data in your dimension view as DISTINCT data. for e.g. SELECT DISTINCT [Product Name], [Product Group], [Product Sub-Group] FROM TABLE
Keep an 'ID' column in each dimension view, for e.g. Product ID in Product view
Create a view for your fact. Include 'ID' column of each dimension in your Fact view. This will help you to create relationship on 'ID' column, which will be a lot faster than relationship created on top of names.
For creating hierarchies in dimension attributes, SSAS provide drag and drop functionality.
If you need more details let me know.
You could construct the dimensions you need by views that based on distinct queries (i.e. SELECT DISTINCT) from the source data. These can be used to populate the dimensions.
You can make a synthetic date dimension fairly easily.
Then you can create a DSV that joins the views back against the fact table to populate the measure group.
If you need to fake a primary key then you can use a view that annotates the fact table with a column generated from row_number() or some similar means. Note that this is not necessarily stable across runs, so you can't rely on it for incremental loads. However, it would work fine for complete refreshes.
I am using access 2007. I made a database called holiday which has 3 tables namely:
client - this has all the client information
flight - this stores flight information
cruise - this stores cruiser information
what I'm thinking of doing, is to make a relationship between these three tables. I just thought myself "relationships" from google and from what I understand is that I should use a one-to-many relationship.
I did that each table has a column called customerID where the client table has it as a primary key and the others as foreign-key. What I want to know is how do I link up the tables so that when I enter information onto the client table both flight and cruise should open as subselection because currently only one is opening and I don't know how to enter the other?
There's 2 ways to create a relationship between tables.
One is permanently with the Relationships Window (under Database Tools in Access 2010). Drag from a field in one table to a field in an other table. Then double click on the line (join) to edit the join type.
The other is to do this temporarily in A Query Builder window. Then you create the join the same way as above. This join is only set in this query only, or anything else based on this query.
OK, now that you them joined, what are your plans. One way is to create a form for editing the customer info, along with two sub-forms for editing the flight & cruise info.
Good luck
I have 4 tables which were auto generated for me:
User
Challenge
Exercise
Challenge_Exercise
One User may have many Challenges, and one Challenge will have many Exercises.
What I noticed is that the Challenge table has a reference to it's parent User (called user_id) but Exercise do not have a reference in it's table to Challenge; their relation is stored in Challenge_Exercise as Challenge_id and exercise_id.
My question is, how would I take out every Exercise that is linked to a specific user? For instance User with id = 1?
SELECT *
FROM excerise,
challenge_excerise,
challenge
WHERE challenge.user_id = 1
AND challenge_excerise.challenge_id = challenge.id
AND challenge_excerise.exercise_id = excercise.id
What I'm doing here is a join, you could also explicitly do it with inner joins (google it if you wanna know more).
This table is needed because you have a many to many relationship, which means each challenge can have multiple exercises, but also each exercise can have multiple challenges. It's a standard to make an extra table then, so you don't have redundant data, this table is often called junction table.
If you want background just google it, there are tons of data to this topic.
Does anyone have a knowledge of a tool that allows to navigate over reliationships between entities in sql server database?
I want to be able to list all rows in a table and then (for selected row) jump to all rows that match (in a context of relation between tables).
The same thing can be done in LINQ to SQL by querying navigation properties but it's not convinient to do this in code all the time.
I tried to use LINQPad but query results are not interactive in this way - again it can be done in code.
Thanks for answers in advance:)
Try PL/SQL Developer, It should be working as you expect.
For eg: If we view a table, the 1st few rows of the table will be shown.
Then when you want to go to a child table or parent table from that. You had 2 types of hierarchy button for each.
The button circled in image was one of them. And this one particularly was for finding child references from this table.
On clicking it you will be show you the table references from this table using the foreign key relation ship. And on selecting one of them it will change the sql query to filter out with the table and column you selected.
The application was a bit different from other tools out in market, but once you got to know how to use it.
I think this is their home page