chilly_bang
Board Regular
- Joined
- Jun 17, 2016
- Messages
- 57
I have a table like
<tbody>
</tbody>
I want to get the following output:
<tbody>
</tbody>
The "normal" transposing is pretty close to what i want - but not exactly, and i miss the point, how to pivot the data to get the goal...
<style type="text/css">.tg {border-collapse:collapse;border-spacing:0;}.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}.tg .tg-0lax{text-align:left;vertical-align:top}</style>
date | organic | referrer | direct |
---|---|---|---|
01.01.2019 | 12345 | 123 | 23 |
25.01.2019 | 23456 | 234 | 34 |
03.03.2019 | 34567 | 345 | 56 |
15.04.2019 | 45678 | 456 | 78 |
<tbody>
</tbody>
I want to get the following output:
type | amount | date |
---|---|---|
organic | 12345 | 01.01.2019 |
referrer | 123 | 01.01.2019 |
direct | 23 | 01.01.2019 |
organic | 23456 | 25.01.2019 |
referrer | 234 | 25.01.2019 |
direct | 34 | 25.01.2019 |
organic | 34567 | 03.03.2019 |
referrer | 345 | 03.03.2019 |
direct | 56 | 03.03.2019 |
organic | 45678 | 15.04.2019 |
referrer | 456 | 15.04.2019 |
direct | 78 | 15.04.2019 |
<tbody>
</tbody>
The "normal" transposing is pretty close to what i want - but not exactly, and i miss the point, how to pivot the data to get the goal...
<style type="text/css">.tg {border-collapse:collapse;border-spacing:0;}.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;}.tg .tg-0lax{text-align:left;vertical-align:top}</style>
Last edited: