You can translate the question and the replies:

Combining rows

We have pulled in data from JIRA using the api as a datasource. After flattening out all of the data, I am seeing duplicate rows with the same ID field, but one column has different values. I'm attempting to combine those values so I only see one entry for each idea, but have been unsuccessful up to this point. Any ideas on how to merge the rows together?
24-07-2019 18:17:01 -0400

1 Answer

Hi, In Virtual Dataport, the flattening view used to expand the nested array values, so it will create duplicate values for non-nested fields. To avoid that I would use [Array_To_String]( Type Conversion Functions instead of flattening view. It will combine the array elements as a single entry. For example, if I have nested data like below, ``` <N1> <id>1</id> <personal> <name>test</name> <age>10</age> </personal> <personal> <name>test2</name> <age>20</age> </personal> <personal> <id>2</id> <personal> <name>test</name> <age>10</age> </personal> <personal> <name>test2</name> <age>20</age> </personal> <personal> </N1> ``` I have created the Selection view on the top XML view and applied Array_To_String in the selection view. > **ARRAY_TO_STRING('-', personal) ** This returns single string that merges the name and age fields separated by a character(‘-’) for each “id”. For more information, you can refer to the document [Type Conversion Functions]( of the Virtual Dataport VQL Guide. Hope this helps!
Denodo Team
25-07-2019 07:54:45 -0400
You must sign in to add an answer. If you do not have an account, you can register here