Forum Discussion

zzzsou's avatar
zzzsou
Frequent Visitor
3 years ago

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)

ProductYear_monthProduct_version
A201901 
A202212 
A202303 
B202303 
..  

 

table 2 (lookup table)

ProductProduct_versionStartDateEndDate
Arevsion1200901202005
Arevsion2202006202212
Arevsion3202301999999
Brevsion1201701202203
............

 

Result what I would like to get is below

 

table 1 (fact table)

ProductYear_monthProduct_version
A201901revsion1
A202211revsion2
A202303revsion3
B202303revsion1
..  

 

Could you kindly help me this problem?

1 Reply

  • bhelou's avatar
    bhelou
    Icon for Responsive Resident rankResponsive 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 ,