chilly_bang
Board Regular
- Joined
- Jun 17, 2016
- Messages
- 57
I have a table like
[TABLE="class: tg"]
<tbody>[TR]
[TH="class: tg-0lax"]date[/TH]
[TH="class: tg-0lax"]organic[/TH]
[TH="class: tg-0lax"]referrer[/TH]
[TH="class: tg-0lax"]direct[/TH]
[/TR]
[TR]
[TD="class: tg-0lax"]01.01.2019[/TD]
[TD="class: tg-0lax"]12345[/TD]
[TD="class: tg-0lax"]123[/TD]
[TD="class: tg-0lax"]23[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]25.01.2019[/TD]
[TD="class: tg-0lax"]23456[/TD]
[TD="class: tg-0lax"]234[/TD]
[TD="class: tg-0lax"]34[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]03.03.2019[/TD]
[TD="class: tg-0lax"]34567[/TD]
[TD="class: tg-0lax"]345[/TD]
[TD="class: tg-0lax"]56[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]15.04.2019[/TD]
[TD="class: tg-0lax"]45678[/TD]
[TD="class: tg-0lax"]456[/TD]
[TD="class: tg-0lax"]78[/TD]
[/TR]
</tbody>[/TABLE]
I want to get the following output:
[TABLE="class: tg"]
<tbody>[TR]
[TH="class: tg-0lax"]type[/TH]
[TH="class: tg-0lax"]amount[/TH]
[TH="class: tg-0lax"]date[/TH]
[/TR]
[TR]
[TD="class: tg-0lax"]organic[/TD]
[TD="class: tg-0lax"]12345[/TD]
[TD="class: tg-0lax"]01.01.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]referrer[/TD]
[TD="class: tg-0lax"]123[/TD]
[TD="class: tg-0lax"]01.01.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]direct[/TD]
[TD="class: tg-0lax"]23[/TD]
[TD="class: tg-0lax"]01.01.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]organic[/TD]
[TD="class: tg-0lax"]23456[/TD]
[TD="class: tg-0lax"]25.01.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]referrer[/TD]
[TD="class: tg-0lax"]234[/TD]
[TD="class: tg-0lax"]25.01.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]direct[/TD]
[TD="class: tg-0lax"]34[/TD]
[TD="class: tg-0lax"]25.01.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]organic[/TD]
[TD="class: tg-0lax"]34567[/TD]
[TD="class: tg-0lax"]03.03.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]referrer[/TD]
[TD="class: tg-0lax"]345[/TD]
[TD="class: tg-0lax"]03.03.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]direct[/TD]
[TD="class: tg-0lax"]56[/TD]
[TD="class: tg-0lax"]03.03.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]organic[/TD]
[TD="class: tg-0lax"]45678[/TD]
[TD="class: tg-0lax"]15.04.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]referrer[/TD]
[TD="class: tg-0lax"]456[/TD]
[TD="class: tg-0lax"]15.04.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]direct[/TD]
[TD="class: tg-0lax"]78[/TD]
[TD="class: tg-0lax"]15.04.2019[/TD]
[/TR]
</tbody>[/TABLE]
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>
[TABLE="class: tg"]
<tbody>[TR]
[TH="class: tg-0lax"]date[/TH]
[TH="class: tg-0lax"]organic[/TH]
[TH="class: tg-0lax"]referrer[/TH]
[TH="class: tg-0lax"]direct[/TH]
[/TR]
[TR]
[TD="class: tg-0lax"]01.01.2019[/TD]
[TD="class: tg-0lax"]12345[/TD]
[TD="class: tg-0lax"]123[/TD]
[TD="class: tg-0lax"]23[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]25.01.2019[/TD]
[TD="class: tg-0lax"]23456[/TD]
[TD="class: tg-0lax"]234[/TD]
[TD="class: tg-0lax"]34[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]03.03.2019[/TD]
[TD="class: tg-0lax"]34567[/TD]
[TD="class: tg-0lax"]345[/TD]
[TD="class: tg-0lax"]56[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]15.04.2019[/TD]
[TD="class: tg-0lax"]45678[/TD]
[TD="class: tg-0lax"]456[/TD]
[TD="class: tg-0lax"]78[/TD]
[/TR]
</tbody>[/TABLE]
I want to get the following output:
[TABLE="class: tg"]
<tbody>[TR]
[TH="class: tg-0lax"]type[/TH]
[TH="class: tg-0lax"]amount[/TH]
[TH="class: tg-0lax"]date[/TH]
[/TR]
[TR]
[TD="class: tg-0lax"]organic[/TD]
[TD="class: tg-0lax"]12345[/TD]
[TD="class: tg-0lax"]01.01.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]referrer[/TD]
[TD="class: tg-0lax"]123[/TD]
[TD="class: tg-0lax"]01.01.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]direct[/TD]
[TD="class: tg-0lax"]23[/TD]
[TD="class: tg-0lax"]01.01.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]organic[/TD]
[TD="class: tg-0lax"]23456[/TD]
[TD="class: tg-0lax"]25.01.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]referrer[/TD]
[TD="class: tg-0lax"]234[/TD]
[TD="class: tg-0lax"]25.01.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]direct[/TD]
[TD="class: tg-0lax"]34[/TD]
[TD="class: tg-0lax"]25.01.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]organic[/TD]
[TD="class: tg-0lax"]34567[/TD]
[TD="class: tg-0lax"]03.03.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]referrer[/TD]
[TD="class: tg-0lax"]345[/TD]
[TD="class: tg-0lax"]03.03.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]direct[/TD]
[TD="class: tg-0lax"]56[/TD]
[TD="class: tg-0lax"]03.03.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]organic[/TD]
[TD="class: tg-0lax"]45678[/TD]
[TD="class: tg-0lax"]15.04.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]referrer[/TD]
[TD="class: tg-0lax"]456[/TD]
[TD="class: tg-0lax"]15.04.2019[/TD]
[/TR]
[TR]
[TD="class: tg-0lax"]direct[/TD]
[TD="class: tg-0lax"]78[/TD]
[TD="class: tg-0lax"]15.04.2019[/TD]
[/TR]
</tbody>[/TABLE]
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: