Page tree


Contents:

   

This section describes how to flatten the values in an Array into separate rows in your dataset.

Source:

In the following example dataset, students took the same test three times, and their scores were stored in any array in the Scores column.

LastNameFirstNameScores
AdamsAllen[81,87,83,79]
BurnsBonnie[98,94,92,85]
CannonChris[88,81,85,78]

Transformation:

When the data is imported, you might have to re-type the Scores column as an array:

Transformation Name Change column data type
Parameter: Columns Scores
Parameter: New type Array

You can now flatten the Scores column data into separate rows:

Transformation Name Expand Array into rows
Parameter: Column Scores

Results:

LastNameFirstNameScores
AdamsAllen81
AdamsAllen87
AdamsAllen83
AdamsAllen79
BurnsBonnie98
BurnsBonnie94
BurnsBonnie92
BurnsBonnie85
CannonChris88
CannonChris81
CannonChris85
CannonChris78

Tip: You can use aggregation functions on the above data to complete values like average, minimum, and maximum scores. When these aggregation calculations are grouped by student, you can perform the calculations for each student.

See Also for EXAMPLE - Flatten an Array:

This page has no comments.