Hi All, I'm new to domo and I've a question on Table joins.
I have two tables table A and table B. Table A is my fact table and Table B is a dimension table. I should do left join since Table A is my fact table. The issue when I do it the total bookings and capacity value in Table B is getting duplicated. I know this is due to many to 1 relationship. when I calculate Total bookings percentage this is giving me wrong values in the card. Can you tell me how to solve this issue ? I've attached here the table pictures and resulting output table I'm getting after I do the left join.
Also I wanted to know, do we need to use only 1 output data set to build cards ? (or) we can use multiple output datasets to build cards and put it in dashboard and does filters work on those cards ?
Best Answer
-
Hi Community,
Finally I found the beast mode to achieve this calculation it goes like this,
MAX(`
Capacity`
) OVER (PARTITION BY `property_id
`)- I used the group by tile in Table B to sum the Capacity and Total bookings of table B to get the sum of Capacity and Total bookings based on the property ID.
- Then left joined the Table A (Left Table) with Table B (Right Table) with `
Property id`
as a Key column and it gave me the duplicate values of total capacity and total bookings in the right table since the relationship between Table A and Table B is Many to One. - Then I used the above Beast mode in the Output Dataset to get the Total capcity and Total Bookings for each property ID and it worked out! Hope this post will be helpful for someone facing the same issue. Thanks all of your great response, appreciate it ;)
0
Answers
-
@Shalini hi, are you joining on property id and check in date? it looks like you may be only joining with the property id.
on a dashboard the cards can be using different datasets but as long as the column names match then filters will works across all of them where it can find a column with the same name
.
0 -
Think of a dashboard as a collection of cards. You can have several cards on the dashboard. They can be text/table cards, charts, etc. Each card would use a single dataset.
If you are joining the datasets, you would create a Magic ETL to handle the logic. In this brief example, we would take two datasets, join them and handle the aggregates with a group tile. Say for example, we want to group totals by date.Our card would use the output dataset (factdimensions_test).
Inside the card, you can do filtering. Or, you could add the card to a dashboard. And add a filter card to the dashboard. The filter card would affect all cards on the dashboard that have the common dataset and field name of the filter.** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
You put multiple cards on a dashboard and the filters work across the cards. In this example, the main card is the green outline at the bottom. The three cards at the top are for filtering. They have chart type: filter. Each of the cards use the same single dataset (result of an ETL or an import, etc).
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
I realize you may only posting a subset of your data, but given what you've shared it seems as if you may want to union (in magic ETL it's called append) Table A and Table B. this would give you all the check in dates and property id's without duplicating bookings and capacity.
0 -
Hi Community,
Finally I found the beast mode to achieve this calculation it goes like this,
MAX(`
Capacity`
) OVER (PARTITION BY `property_id
`)- I used the group by tile in Table B to sum the Capacity and Total bookings of table B to get the sum of Capacity and Total bookings based on the property ID.
- Then left joined the Table A (Left Table) with Table B (Right Table) with `
Property id`
as a Key column and it gave me the duplicate values of total capacity and total bookings in the right table since the relationship between Table A and Table B is Many to One. - Then I used the above Beast mode in the Output Dataset to get the Total capcity and Total Bookings for each property ID and it worked out! Hope this post will be helpful for someone facing the same issue. Thanks all of your great response, appreciate it ;)
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 731 Beast Mode
- 55 App Studio
- 40 Variables
- 682 Automate
- 175 Apps
- 451 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 122 Manage
- 119 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 107 Community Announcements
- 4.8K Archive