Last active
September 10, 2018 15:51
-
-
Save joel-bernstein/17240409050e85ea9ebe22793816be3c to your computer and use it in GitHub Desktop.
Temporal Filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
complement(on="Product_s, Actual_Start_Date_dt", | |
sort(by="Product_s asc, Actual_Start_Date_dt asc", | |
having(select(innerJoin(search(cp, q="*:*", fl="id, Product_s, Reported_Date_dt", sort="Product_s asc", qt="/export"), | |
search(cp-changes, q="*:*", fq="Actual_Start_Date_dt.epoch:[1 TO *]", fl="id, Product_Name_s, Actual_Start_Date_dt", sort="Product_Name_s asc", qt="/export"), | |
on="Product_s=Product_Name_s"), | |
id, Product_s, Product_Name_s, Reported_Date_dt, Actual_Start_Date_dt, sub(epoch(Reported_Date_dt), epoch(Actual_Start_Date_dt)) as diff), | |
and(gt(diff, 0), lt(diff, 86400000)))), | |
sort(by="Product_s asc, Actual_Start_Date_dt asc", | |
having(select(innerJoin(search(cp, q="*:*", fl="id, Product_s, Reported_Date_dt", sort="Product_s asc", qt="/export"), | |
search(cp-changes, q="*:*", fq="Actual_Start_Date_dt.epoch:[1 TO *]", fl="id, Product_Name_s, Actual_Start_Date_dt", sort="Product_Name_s asc", qt="/export"), | |
on="Product_s=Product_Name_s"), | |
id, Product_s, Product_Name_s, Reported_Date_dt, Actual_Start_Date_dt, sub(epoch(Reported_Date_dt), epoch(Actual_Start_Date_dt)) as diff), | |
and(lt(diff, 0), gt(diff, -86400000))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah, I was thinking the same thing. This would be a generalized approach for adding complex join constraints.