nPath Example 5: Find First Product with Multiple Referrers in Any Session - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantage™

Input

SQL Call

SELECT * FROM nPath@coprocessor (
  ON aggregate_clicks PARTITION BY sessionid ORDER BY clicktime
  USING
  Mode (nonoverlapping)
  Pattern ('REFERRER{2,}')
  Symbols (referrer IS NOT NULL AS REFERRER)
  Result (FIRST(sessionid OF REFERRER) AS sessionid,
          FIRST(productname OF REFERRER) AS product)
) AS dt;

Output

sessionid product
1 envelopes
2 tables
3 bookcases
4 tables
5 Appliances