According to this article, starting with sqlserver 2016+, bidirectional filtering was introduced to eliminate DAX queries need for many-to-many relationships to be created.
i set the filter directions to both tables on my tabular project
as you can see, a many-to-many relationship still doesnt show up.
we have a requirement for many to many but why cant i see it even though i have sql server 2017 and VS 2017??
Related
I'm trying to create a cocktail database where I can look up any classic cocktail and check if I have the ingredients required for making it. I use visual studio 2022. My knowledge about SQL is very outdated but would like to try anyway.
I understand database normalization is what I need to do here. Furthermore it seems difficult to store several ingredients by ID into a recipe table. I've been looking into arrays in SQL and understand that is not straight forward. Anyone who have an idea about how I can set up this database correct? Next thing after creating the database the way I want it is to program a web app in C# to use the database.
I've tried many times to create tables in SQL in visual studio and can insert and select from created tables. However, getting what I want by storing several ingredients from one SQL table into a recipe table containing several ingredients seems difficult for me to understand.
errori'm new here ,and in the ssas tabular modeling, im working on a project and i have to do a many to many relationship in ssas tabular 2016 BUT they give me this probleme.
my model is like this where index is note a primary key in both tables and i want to join the two tables with it.
thank you all !
model2
SSAS 2016 & 2017 does not support the Many-To-Many Relationship nativity in SSAS, you will have to use a bridge table. One other option which may meet your requirements is to activate the Bi-Directional filter in a Many-To-One relationship. A good outline is blogged about here.
Only SSAS 2019/Azure Analysis Services (Compatibility level 1500) & Power BI allows the native selection of Many-To-Many relationships.
In databases you can define relationships between tables. But what exactly is the use, besides documentation, of making these relationships explicit in a diagram (for example by connecting the keys in SQL server management studio)?
Does it give you any advantage in writing SQL statements? Computation time? Memory usage? Usually you "repeat" the relationship in the join statement. I have the feeling I'm missing something trivial.
Thanks
From the fine manual
You can use Object Explorer to create new database diagrams. Database diagrams graphically show the structure of the database. Using database diagrams you can create and modify tables, columns, relationships, and keys. Additionally, you can modify indexes and constraints.
You asked:
Does it give you any advantage in writing SQL statements?
They can tell you how the datase is structured. That's usually pretty key to understanding it, and reading all the FKs into your head and remembering which table relates to what can be quite the puzzle and even then not actually relate to how the data is used and related in-application
Computation time?
Not quite sure what this means, but the presence or absence of a database diagram won't impact the amount of time your SQL Server spends planning or executing queries
Memory usage?
Not really
Usually you "repeat" the relationship in the join statement
Sometimes; there are ways of joining data without using joins, and presence or absence of FKs or database diagrams have nothing to do with SQLS ability to join data
It might be best to think of DB Diagrams as a visual design aid and tool
I've Imported multiple tables in my tabular model in SQL Server Analysis Services, after importing, I changed my tables structure and defined foreign keys. now my tabular model doesn't understand my changes and not showing me my relationships.
Does any body has any idea how to update my table relationships without recreating project?
Thanks.
I Opened my project in Data Tools AND Viewed it as Code. In View Code Mode, I Changed My Relationships And Added New Columns, Renamed My Columns And pretty much, Changed Everything.
It is more complicated than Design View but I think Its more powerful.
I was looking for this for a long long time, thought it may happen to you too, so I posted in here. :)
I am working on spiking out a BI solution and I am trying to create a Hierarchy in out 'Client' dimension more or less to replicate what I know the end users will do.
The Client dimension table has 3 foreign key relationships with other tables, each of these relationships are standalone from the others. They are Role, Service Type, and Status.
Whenever this dimension will be used it will almost always be with the Role attribute first so I tried to create hierarchies like Role -> Service Type -> Client. Now when I try to process with this setup I get the error "The table that is required for a join cannot be reached based on the relationships in the data source view"
Is there any way to create a Hierarchy with disparate attributes like this?
It isn't possible to build a hierarchy across multiple dimensions that are not related to one another in that way.
One option would be to restructure your schema to a Star schema rather than a Snowflake schema. If that's not an option, depending on the details you might be able to build a query in SSAS or a view in SQL server, and then create a dimension in SSAS from that.
From the information given it's hard to judge whether Role, Service Type, and Status should be in separate tables, but have a good think about this. Should the attributes you want to use from them actually be attributes of Client? Would doing this allow you to get rid of some of those tables and/or reduce the amount of Snowflaking? Remember that dimensional models are very different from a normal relational model: the aim is to keep the number of joins low, and it can be acceptable to repeat attributes in different tables if that's going to be more efficient. Of course, sometimes restructuring just isn't a realistic prospect, which is where a query or view might come in useful to work around this issue.
I've been learning SSAS recently myself, and have found that when I'm struggling to get something working in SSAS, the problem is very often the underlying schema not being set up in the best way for what I'm trying to accomplish.
(Apologies if this is a little vague but it's difficult to be more detailed without knowing the nature of the data, and I don't yet have the ability to comment and ask for more information!)