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](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/appendix/syntax_of_condition_functions/type_conversion_functions#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](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/appendix/syntax_of_condition_functions/type_conversion_functions#type-conversion-functions) of the Virtual Dataport VQL Guide.
Hope this helps!