Forum Discussion
zzzsou
3 years agoFrequent Visitor
How to use related function from other table's date condition
Hello,
I would like to use related function from other table's date condition.
Here is my data set
table 1 (fact table)
| Product | Year_month | Product_version |
| A | 201901 | |
| A | 202212 | |
| A | 202303 | |
| B | 202303 | |
| .. |
table 2 (lookup table)
| Product | Product_version | StartDate | EndDate |
| A | revsion1 | 200901 | 202005 |
| A | revsion2 | 202006 | 202212 |
| A | revsion3 | 202301 | 999999 |
| B | revsion1 | 201701 | 202203 |
| ... | ... | ... | ... |
Result what I would like to get is below
table 1 (fact table)
| Product | Year_month | Product_version |
| A | 201901 | revsion1 |
| A | 202211 | revsion2 |
| A | 202303 | revsion3 |
| B | 202303 | revsion1 |
| .. |
Could you kindly help me this problem?
1 Reply
- bhelou
Responsive Resident
Dear ,
to Use related function the source table should have a unique identifier ( like the product # should not be duplicated ) in your case if the year_month is unique , try to concatitane it in the source table and the table fact
and your relationship should be one to many .
Regards ,