Hello,
I have 2 fact tables, with the same granularity level, and 1 dim table that needs to be connected to the 2 fact tables.
The problem is, that each fact table has different data in the join fields, so the dim tables will join only to the table I’ll make the connection with.
For example:
Fact table 1-
Date FarmId val1
1.1.23 1 1
1.2.23 2 1
Fact Table 2-
Date FarmId val2
1.3.23 1 1
1.4.23 2 1
Dim table-
FarmId FarmName
1 Edo
2 Eli
How can I get a dataset that looks like this:
Date FarmName val1 val2
1.1.23 Edo 1 1
1.2.23 Eli 1 1
1.3.23 Edo 1 1
1.4.23 Eli 1 1
But in case there are similar dates in both fact tables, the two fact tables won’t connect based on the date, only based on the ‘farmId’ won’t it?
The join between the fact tables needs to be on the fields ‘date’ and ‘farmId’.
Try to join the fact tables with full join on Date and Farm id with in one datasetA.
Use that datasetA in another datasetB and left join on farm id the dim.