Hi,
How to achieve binary search (If exact match pick exact value else closest Upper value. If Upper value is not available the pick the lower value) in Alteryx?
id | Period | value |
100 | 2 | Upper Period 3 value-0.8765 |
101 | 4 | Exact Match period 4-1.3654 |
102 | 7 | upper period 8 value |
103 | 10 | lower period 8 value |
Lookup Data
Period | Value |
3 | 0.8765 |
4 | 1.3654 |
8 | 1.3654 |
Thanks,
Mark
Solved! Go to Solution.
what you'll need to do is GENERATE ROWS on the table. Create all possible periods and the join to the results. 3 becomes 1,2,3. 4 becomes 4,5,6. 7 becomes 7,8,9. 10 goes to max.
cheers,
mark
Hello @mark_paul,
This should do it:
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regards