Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table that has one column that is in this format
Header 1 |
---|
Dimension1 |
Dimension2 |
Dimension3 |
Dimension4 |
Dimension5 |
Metric_Value_1 |
Metric_Value_2 |
Metric_Value_3 |
Metric_Value_4 |
Metric_Value_5 |
Dimension6 |
Dimension7 |
Dimension8 |
Dimension9 |
Dimension10 |
Metric_Value_6 |
Metric_Value_7 |
Metric_Value_8 |
Metric_Value_9 |
Metric_Value_10 |
5 dimension followed by 5 metrics I want the table to be transformed into a table that looks like this
Age | City | State | Country | Zip | Views | Likes | Ups | Downs | Overs |
---|---|---|---|---|---|---|---|---|---|
Dimension1 | Dimension2 | Dimension3 | Dimension4 | Dimension5 | Metric_Value_1 | Metric_Value_2 | Metric_Value_3 | Metric_Value_4 | Metric_Value_5 |
Dimension6 | Dimension7 | Dimension8 | Dimension9 | Dimension10 | Metric_Value_5 | Metric_Value_6 | Metric_Value_7 | Metric_Value_8 | Metric_Value_9 |
The idea here is that there are always 5 dimension followed by 5 metrics associated with those dimension
***There is an unknown amount of rows in the column but it will be a multiple of 10
Let me know if any other information is needed.
Thanks in advance.
Temp:
Load
Mod(RowNo(),10) as Key,
1 as ID,
Header
Inline
[
Header
Dimension1
Dimension2
Dimension3
Dimension4
Dimension5
Metric_Value_1
Metric_Value_2
Metric_Value_3
Metric_Value_4
Metric_Value_5
Dimension6
Dimension7
Dimension8
Dimension9
Dimension10
Metric_Value_6
Metric_Value_7
Metric_Value_8
Metric_Value_9
Metric_Value_10
];
Data:
Load RowNo() as Link, Header as Age Resident Temp Where Key = 1;
Left Join (Data)
Load RowNo() as Link, Header as City Resident Temp Where Key = 2;
Left Join (Data)
Load RowNo() as Link, Header as State Resident Temp Where Key = 3;
Left Join (Data)
Load RowNo() as Link, Header as Country Resident Temp Where Key = 4;
Left Join (Data)
Load RowNo() as Link, Header as Zip Resident Temp Where Key = 5;
Left Join (Data)
Load RowNo() as Link, Header as Views Resident Temp Where Key = 6;
Left Join (Data)
Load RowNo() as Link, Header as Likes Resident Temp Where Key = 7;
Left Join (Data)
Load RowNo() as Link, Header as Ups Resident Temp Where Key = 8;
Left Join (Data)
Load RowNo() as Link, Header as Downs Resident Temp Where Key = 9;
Left Join (Data)
Load RowNo() as Link, Header as Overs Resident Temp Where Key = 0;
Drop Table Temp;
Drop Field Link;