Transpose
configuration-examples Transpose
Transposing a table means changing the rows to columns and columns to rows.
example
// Starting set, to be transposed. Woningtypes are the rows (domain unit), and the actors the columns (attributes).
container PerActor :=
for_each_nedv(
Actors/name
, 'PerActorType/' + Actors/name + '/sum'
, WoningTypes
, float32
);
// Transposed set. Actors are the rows (domain unit), and woningtypes the columns (attributes)
container PerWoningType :=
for_each_nedv(
WoningTypes/name
, 'union_data(Actors,'+replace(AsItemList('PerActor/'+Actors/name+'[WoningTypes/V/@WT@]'),'@WT@', WoningTypes/Name)+')'
, Actors
, float32
);