Forum Discussion
Help with relationships
- 4 years ago
Sounds like in your Weights database that the Part Group is not unique. Best way to tell: Add that column THREE times to a table visual. Leave the first one as it is, change the aggregation of the second to DISTINCT COUNT, and change the aggregation of the third to COUNT. Now look at the bottom numbers. If the COUNT = DISTINCT COUNT then the Part Group values are unique.
If you can get the Part Group values to be unique in the Weights database, then the relationship can be One-to-One, which makes sense for your mode.
My apologies for the late response, my work shuts down for the weekend. Yes sorry i meant to say im making a table visual on a report page by adding the groupings from the grouping table and the weight from the weight table.
I do indeed have a 1 to 1 relationship between them and below is a snapshot of the relationships
I'm not sure if i can show much sample data, but i can show the difference in the actual returns table and the Weight table.
As you can see the weight table, which is on the right is identical across all rows, but the reutrns table works perfectly. The actual reutnrs table uses, Actual returns from the Base datatable, Groupings from the grouping database table and quarter from the base data table.
The weight table however uses, quarter from the base data table, groupings from the grouping database and Gross weight from the weight database.
As displayed, the Groups table cannot 'filter' the Weights table because the FILTER DIRECTION on the relationship (from Base to Weights) is "one-way".
Two options:
- Remove the relationship from Base to Weights, and activate the relationship (dotted line = not active) between Groups and Weights.
- Change the Cross Filter Direction of both active relationships from "Single" to "Both"
As a general rule, I never keep around in-active relationships in my models. They just clutter things up and don't contribute to anything.
Either one of the above two actions should allow the Groups database to 'filter' the Weights database.
Hint: Table can only 'filter' other tables when the relatinship lines 'point' from one to the other. In your current state, Groups 'point to / can filter' Base, and Weights 'points to / can filter' Base. With bi-directional filtering turned on, Base would be alble to filter the other two. The net result of that would be that Groups would 'filter' Base, and Base would in turn 'filter' Weights.
Hope that helps.
- Kieran-q_204 years agoHelper I
I have removed the Base to weights realtionship and Made the Group and weight realtionship active. Is the data im trying show maybe the problem? Just to clairfy, partgroups have an assigned weight in the weight table. The partgroups are then grouped together in the groupings table. But when i try to display weight by grouping in a report, It doesnt display what i want. Is that because its not using the partgroups from the base data table?
- ToddChitt4 years agoSuper User
I think it's time to show some sample data from each of the three tables, and maybe a mock-up of what your target visual should look like.
- Kieran-q_204 years agoHelper I
You're right, I'll just go through each sources of the data quickly.
Above is the weights table data. The list is a lot longer but as you can see the part group is displayed alongside its relevant weight.
Above is the groupings table, Here the the part group is displayed alongside its relvant grouping, There are many different groupings as the list goes on such as Drive, Rack, Cards etc.
Finally, above is a snippet of the base data. The part group is displayed here also. Per my earlier line of questioning, you can see the actual returns are displayed in the base data on column R. Creating a table with groupings and returns thus turned out fine. The problem lies with displaying the weight by group effectively.
I think the best way to display the visual i am looking for is above. The returns dollar amount by grouping is the table on the left and that table is perfect. But on the right is the weights table which is for some reason displaying identical values.
- ToddChitt4 years agoSuper User
What are Q1 and Q2? Calendar Quarters? Your Weights data is NOT dependent on time.
If you have a one-to-one relationship between Groups and Weights (on Part Group) and you build a table visual showing the Group and sum of (Weight), you should get correct data. Take the other columns out of the table.