Traverse through an array
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 10:49 AM
Hi,
I have data in array format in two different streams , I want to check whether the array elements of the 1st stream are present in the 2nd stream or not. How should I do that?
-
[“1001”,“1003”]
-
[“1001”,“1002”,“1003”,“1004”]
I have tried using map function after Merge Join and I am able to access the elements of any stream but cannot compare it with the elements of second stream. Can you please suggest how can I achieve this.
Regards,
Shreegeet

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 11:40 AM
Hello @shreegeet
I’ve come up with a solution with a diff snap, that includes splitting the arrays… Please see the pipeline , unmodified view of the Diff snap contains elements that are present in the both arrays.
test3_2020_06_12.slp (10.5 KB)
BR
Dimche Saveski

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2020 12:54 AM
array1.filter((x,y,z)=> array2.indexOf(x) == -1).length > 0 ? ‘An element/s in array1 but not in array2’ : ‘All elements in array1 is in array2’
