Find matching range in another dataset
![yankees9920](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar16.png)
I have a dataset of properties and their prices
Address | Price |
123 Main St | 450,000 |
1 Broadway | 750,000 |
and another dataset that contains scores based on where the price falls within the range
LowRange | HighRange | Score |
0 | 499,999 | 10 |
500,000 | 1,000,000 | 5 |
I'm looking to append a row to the first table that does a lookup to see what the score should be and would expect the following output.
Address | Price | Score |
123 Main St | 450,000 | 10 |
1 Broadway | 750,000 | 5 |
I can't join these tables since they have no IDs in common and I haven't figured out a way to reference another dataset in a formula during the Prepare step. Any help would be appreciated!
Best Answer
-
Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,211 Dataiker
Hi @yankees9920
,You should still be able to use a Join recipe in this case but with multiple join conditions with <= and >=
Let me know if that works for you!
In my example LowRange is min and HighRange is max. Output was :
Answers
-
Thank you very much, not sure how I missed that.
I have multiple scoring ranges/criteria that I use and I just discovered that I could use pre-joined computed column to further filter each join by the appropriate type