adventurous1
Programmer
Hi all...
Hopefully somebody can help me with this question..
I am trying to write a "simple" report to track the number of visitors and dwell time (total and per page) by page navigation for a user visiting a website. The problem is is that I have row level data that I need to convert to columns. The data is in a similar format to this:
Visitor ID Page ID Page Name Dwell Time Begin Time
--- --- --- ------------ ----------
01 31 Home 18 12:00
01 32 Car 22 12:19
01 33 Truck 16 12:41
01 34 Bus 5 12:56
01 35 Review 35 01:01
01 36 Pay 15 01:36
01 37 Confirmation 23 01:51
02 31 Home 18 03:00
02 32 Car 63 03:18
02 35 Review 9 04:21
02 36 Pay 33 04:30
And needs to be converted (ideally) to this:
31 32 33 34 35 36 37 Count(Visitor ID) sum(DTime)
-- -- -- -- -- -- -- ----------------- ---------
x x x x x x x 1 124
x x x x 1 123
Can anyone help me with this? I think this could potentially be done via a PL/SQL procedure to transpose the rows but have no idea how to do it.
Any help anyone can offer is appreciated.
Thanks,
Adventurous1
Hopefully somebody can help me with this question..
I am trying to write a "simple" report to track the number of visitors and dwell time (total and per page) by page navigation for a user visiting a website. The problem is is that I have row level data that I need to convert to columns. The data is in a similar format to this:
Visitor ID Page ID Page Name Dwell Time Begin Time
--- --- --- ------------ ----------
01 31 Home 18 12:00
01 32 Car 22 12:19
01 33 Truck 16 12:41
01 34 Bus 5 12:56
01 35 Review 35 01:01
01 36 Pay 15 01:36
01 37 Confirmation 23 01:51
02 31 Home 18 03:00
02 32 Car 63 03:18
02 35 Review 9 04:21
02 36 Pay 33 04:30
And needs to be converted (ideally) to this:
31 32 33 34 35 36 37 Count(Visitor ID) sum(DTime)
-- -- -- -- -- -- -- ----------------- ---------
x x x x x x x 1 124
x x x x 1 123
Can anyone help me with this? I think this could potentially be done via a PL/SQL procedure to transpose the rows but have no idea how to do it.
Any help anyone can offer is appreciated.
Thanks,
Adventurous1