Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: awilliams1024I'm glad you found a solution.
You can convert NULL string values or empty/whitespace strings to a NULL date type using the equivalent of this in a Filter node:
if isNull(DateStr) or trim(DateStr) == "" then {
START_DATE = date(null)
} else {
START_DATE = date(DateStr,"CCYY-MM-DD")
}
emit START_DATE
Note that a NULL value is effectively treated as the lowest possible value so when looking for dates before a threshold the NULL values would also be included in the output.
If you wanted to exclude the NULL records you could modify your date filter to have the following code:
if firstExec then {
Threshold_DT = date("2017-07-01","CCYY-MM-DD")
}
Match_Before = dateSubtract(START_DATE, Threshold_DT) < 0
Match_NotNull = isNotNull(START_DATE)
emit * where Match_Before and Match_NotNull