โ07-08-2023 02:05 AM
Hi,
I have one requirement in this there is one API return list of values comma separated and Another column coming from Snowflake and I need to compare and generate a flag
Note : order of strings are not fixed
Example Column1: [โSTRING1โ,โSTRING2โ,โSTRING3โ,โSTRING4โ]
Column2: [โSTRING1โ,โSTRING2โ,โSTRING3โ,โSTRING4โ]
โ07-08-2023 12:48 PM
Hello @Rahul,
You can compare the two list by first merging them using the Join Snap. Then, using the following expression in a Mapper Snap to compare the lists:
$api_list.length == $snowflake_list.length ? ($api_list.filter(x => $snowflake_list.indexOf(x) != -1).length == $api_list.length) : false
Here is a sample pipeline:
โsl-comm-compare-lists_2023_07_08.slp (6.6 KB)
Let me know if this is of any help. ๐
Regards,
Aleksandar.
โ11-20-2023 12:04 AM - edited โ11-20-2023 12:15 AM
@AleksandarAngel - Can you please share the sample pipeline as I am getting Page not found error
โ11-20-2023 03:30 AM
โ11-20-2023 05:56 AM
Thank you @AleksandarAngel
Also, Is there a way to easily show what key values do not match between two JSON objects?