Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

How To: Join on Ranges in SQL and Alteryx

AngelaO
Alteryx Alumni (Retired)
Created

In SQL, you can join on a range, using code similar to the below snippet.

SELECT Column, FruitName, StartDateTime, EndDateTime FROM dbo.Fruit_List INNER JOIN dbo.Greek_Alphabet ON dbo.DateTime BETWEEN dbo.FruitList_StartDateTime AND dbo.FruitList_EndDateTime

Alteryx does not have a "join on range" command, but you can get the same result by appending all records and using a filter tool.

join1.JPG

join7.JPG

For Advanced Joins: when a value from one file is between (< or >) a value from another file, visit and download the Advanced Join Macro.

Attachments
Comments
Hugo
9 - Comet

Is there any plans to build a dedicated join on range tool at all? Appending all records, or creating records then discarding them as suggested in the Join on date range articles, can be very impractical when dealing with large data sets

Atabarezz
13 - Pulsar

When you are working with billions of rows of data and joining it with at least 10s of millions

an append will result in catastrophic compute times and will need huge disks I suppose...

 

An In-db version would be easier to build I believe...

agrabbs
5 - Atom

This has to be a joke right? There is no other way to join between a range? I have a request where this will cause millions of unnecessary lines and processing. 

This is viable only for trivially small data sets