โ08-17-2020 03:20 PM
Judging from the options available in the Aggregate Snap, I would expect it to work much like the identically named aggregate functions in SQL. SQL functions like COUNT, AVG, SUM, and MAX conveniently skip over NULLs and return the same values as they would if the NULLs were not there.
However, for CONCAT this does not appear to be the case.
I am running into problems when the attribute I am trying to aggregate from the document stream either does not exist or is null.
For example, if I had $original.foo as the input field in the document stream that looked something like (โabcโ, โxyzโ, null, โaaโ, undefined, โbbโ) and was mapping CONCAT of that to an output field โbarโ, I would expect bar to look like: โabc|xyz|aa|bbโ. Instead I get errors: โfoo was not found while evaluating the sub-expression โ$original.fooโโ and โ$original.original.LegacyKey is undefined. Perhaps you meantโฆโ
How do I write the input field expression so nulls and undefineds are simply ignored?
Or is this a bug in CONCAT / Aggregate?
Thanks in advance!
(PS: I donโt think I want a string with back-to-back delimiters, e.g. โabc|xyz||aa||bbโ if I can avoid it, but even that would be better than failing on error.)
Solved! Go to Solution.
โ08-17-2020 04:36 PM
$.filter((value, key) => (key==โfooโ && value!=โnullโ))
For reference.
Community1_2020_08_17.slp (7.2 KB)
โ08-17-2020 04:36 PM
$.filter((value, key) => (key==โfooโ && value!=โnullโ))
For reference.
Community1_2020_08_17.slp (7.2 KB)