GROUP_PATH_CHANGES
Syntax
GROUP_PATH_CHANGES(<any>)
Description
Create paths from a field, but only if the value changes. This function can be used for click stream analysis.
This is a group series function.
Example
Analyze click streams, group on a session, sort by timestamp, and generate the clicks paths.
Given the following data:
session | timestamp | url |
---|---|---|
session1 | 2 | url1 |
session1 | 3 | url1 |
session1 | 4 | url2 |
session2 | 5 | url1 |
session2 | 6 | url2 |
session1 | 7 | url3 |
session2 | 8 | url1 |
session1 | 9 | url2 |
session2 | 10 | url1 |
First create a group using GROUPBY(#RawData!session).
session |
---|
session1 |
session2 |
Next, sort your timestamp in ascending order using GROUP_SORT_ASC(#RawData!TimeStamp).
sessions | Ascending_TimeStamp |
---|---|
session1 | 2 |
session1 | 3 |
session1 | 4 |
session1 | 7 |
session1 | 9 |
session2 | 5 |
session2 | 6 |
session2 | 8 |
session2 | 10 |
Then use the GROUP_PATH(#RawData!url). The result shows paths for values that have changed in the column, in ascending order, in relation to the GROUPBY() column.
Sessions | Ascending_TimeStamp | url_PATH_CHANGE |
---|---|---|
session1 | 2 | ["external","url1"] |
session1 | 4 | ["url1","url2"] |
session1 | 7 | ["url2","url3"] |
session1 | 9 | ["url3","url2"] |
session1 | 9 | ["url2","external"] |
session2 | 5 | ["external","url1"] |
session2 | 6 | ["url1","url2"] |
session2 | 8 | ["url2","url1"] |
session2 | 10 | ["url1","external"] |
Also see:
- GROUP_PATH To not filter out paths where the URL doesn't change.
- GROUPBYGAP To extract sessions from gaps in a timestamp.