view view flatten prop
Returns a new view with structure and values derived from view as follows. The prop argument must name a sub-view property in the rows of view. In the returned view, the property prop is replaced by all the properties of the rows of prop. There is a row in the returned view for every row in a prop sub-view in view.
Perhaps a graphic example is easier than words. If view has 3 rows with 3 properties, a, b, c, and property b is a sub-view, like:
a b c
b1 b2 b3
------------------------------
A0 |B01a |B02a |B03a |C0
|B01b |B02b |B03b
|B01c |B02c |B03c
------------------------------
A1 |<no rows> |C1
------------------------------
A2 |B21a |B22a |B23a |C2Then the returned view from [view view flatten b] will have 4 rows with 5 properties, a, b1, b2, b3, c, like so:
a b1 b2 b3 c
------------------------------
A0 |B01a |B02a |B03a |C0
A0 |B01b |B02b |B03b |C0
A0 |B01c |B02c |B03c |C0
A2 |B21a |B22a |B23a |C2If the subview prop has a property with the same name as a property of the rows of view (other than prop itself), the property values from view will appear for that property name in the returned view.