How do you loop through a column of data to create a table with. The number of columns will be constant based on the first x number of rows but the number number of entries will vary based on the number of personnel records. The database pull gives all the data in a single column, but it needs to be formatted to a table.
Default format
General Data |
---|
Name |
Age |
City |
Bob |
31 |
Paris |
John |
24 |
Washington |
Jill |
45 |
Vancouver |
How do you loop through a column of data to create a table with. The number of columns will be constant based on the first x number of rows but the number number of entries will vary based on the number of personnel records. The database pull gives all the data in a single column, but it needs to be formatted to a table.
Default format
General Data |
---|
Name |
Age |
City |
Bob |
31 |
Paris |
John |
24 |
Washington |
Jill |
45 |
Vancouver |
The first X number of rows would be the table headers, and the following series of rows would be the data in each column.
Desired Format
Name | Age | City |
---|---|---|
Bob | 31 | Paris |
John | 24 | Washington |
Jill | 45 | Vancouver |
1 Answer
Reset to default 0you can try this in PQ
create two index columns and modulo one column
select index column and pivot columns
modulo index 1column
select three columns and fill down
at last filter index 1 = 2