08-21-2023 01:55 PM - edited 08-21-2023 01:57 PM
I have one document structured like this:
FirstName | LastName | Title |
Ann | Smith | Ms |
June | Jones | Mrs |
Sam | Johnson | Mrs |
And a second document like this:
Label | Value |
MyEvent | 8/21/23 |
I'm trying to merge them together to get a final product like this:
FirstName | LastName | Title | Value |
Ann | Smith | Ms | 8/21/23 |
June | Jones | Mrs | 8/21/23 |
Sam | Johnson | Mrs | 8/21/23 |
I'm trying to append the Value column and repeat the value for every row in the first table. I've tried Union and Join but without success. What would be the correct Snap for this use case?
Solved! Go to Solution.
08-21-2023 11:58 PM - edited 08-22-2023 12:02 AM
Hi @maahutch ,
You can try Join Snap. You will need to specify the type Inner Join and hardcode the value 1 as the left and right paths.
And after that in the mapper snap, you will remove the Label column, or you can use this mapper for removing the Label column before the join snap. 🙂
Hope this helps!
BR.
Ivica
08-21-2023 11:58 PM - edited 08-22-2023 12:02 AM
Hi @maahutch ,
You can try Join Snap. You will need to specify the type Inner Join and hardcode the value 1 as the left and right paths.
And after that in the mapper snap, you will remove the Label column, or you can use this mapper for removing the Label column before the join snap. 🙂
Hope this helps!
BR.
Ivica
08-22-2023 10:51 AM
Hi @maahutch ,
Good day, here's my suggestion first convet the second document into a key-value pair then use join snap to merge it from the streaming documents
I assume that the value from "Label" will be the keyname then value from "Value" will be the value
Expression: sl.ensureArray($.values().join('|')).toObject(v=> v.split('|')[0], v=> v.split('|')[1] )
Target Path: $