11-15-2018 06:26 AM
Dear Community
I need your help with understanding the group by in the attached simple pipeline.
I am supplying the Json data and sorting and grouping it by ID as in the picture but for each Group, i.e. ID. Then I need to first determine if a type of address exists e.g. “BUS” business or “RES” residential and then transform, e.g. via a mapper, to output both the business and residential addresses to Mapper variables $Business and $Residential output as one document/record
Thank you very much for your help in advance,
Andre M
11-15-2018 08:24 AM
The groupby also included the address
11-15-2018 10:54 AM
I’m not clear on what you’re doing with the Router there.
Perhaps it would be easier if you stated the overall goal. Are you trying to turn the JSON input into a CSV file?
11-22-2018 07:58 AM
Good day tstack,
Thanks again but if I have two values i wanted to output below, e.g Value and Value2, based on Address: ‘BUS’, how would edit the code below to achieve this?
match $group {
[…, { Address: “BUS”, Value }, …] => Value
}
Thank you very much in advance,
Andre
11-22-2018 04:01 PM
You can add more property names to the pattern (the left side of the ‘=>’ in the match block) to capture them and make them available for the expression on the right side of the ‘=>’. I’m not sure what you want to do with the value, so I just concatenated them into a single string:
match $group {
[…, { Address: “BUS”, Value, Value2 }, …] => Value + " " + Value2
}
11-23-2018 11:29 AM
Many thanks for the feedback on this. I used it and works good.
-Andre