Johan_Van_Noten
New Contributor III

Thanks guys,

@Lav Chandaria​ and @Raghu Bindinganavale​ 's solutions both work, but as indicated in my reply above, I'm worried about the performance of evaluating the datediff (Lav) or the label (Raghu) over the full dataset without the engine being able to just cut away "half" of the potential outcomes based on the single < and information from an index / partition. (see my comment above to Raghu).

I'll try it on a significant dataset once I get the opportunity.

Johan