1.1 - 8.10 - nPath Example: Pages Visited in Each Session - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Release Date
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)

This example accumulates the pages visited in each session.

SQL Call

SELECT * FROM NPath@coprocessor (
  ON aggregate_clicks PARTITION BY sessionid ORDER BY clicktime
  USING
    Mode(nonoverlapping)
    Pattern('A*')
    Symbols(true AS A)
    Result(first(sessionid of A) AS sessionid,
           accumulate(pagetype of A) AS path)
) AS dt;

Output

 sessionid path                                                                                                                                       
 --------- ------------------------------------------------------------------------------------------------------------------------------------------ 
         4 [home, home, home, home, home, home, home1, home1, home1, page1, page1, page1]                                                            
         2 [home, home, home, home, home, home, home, home, home, home1, page1, checkout, checkout, home, home]                                      
         3 [home, home, home, home, home, home, home, home, home1, page1, home, home1, page1, home]                                                  
         1 [home, home1, page1, home, home1, page1, home, home, home, home1, page1, checkout, home, home, home, home, home, home, home, home, home]  
         5 [home, home, home, home, home1, home1, home1, page1, page1, page1, page2, page2, page2, checkout, checkout, checkout, page2, page2, page2]