7.00.02 - SQL-MapReduce Call - Aster Analytics

Teradata Aster® Analytics Foundation User GuideUpdate 2

Product
Aster Analytics
Release Number
7.00.02
Release Date
September 2017
Content Type
Programming Reference
User Guide
Publication ID
B700-1022-700K
Language
English (United States)
SELECT * FROM nPath (
  ON (SELECT customer_id, session_id, datestamp, page
      FROM bank_web_clicks) AS alias
  PARTITION BY customer_id, session_id
  ORDER BY datestamp
  MODE (NONOVERLAPPING)
  PATTERN ('(DUP|A)*')
  SYMBOLS (
    'true' AS A,
    page = LAG (page,1) AS DUP
  )
  RESULT (
    FIRST (customer_id OF any (A)) AS customer_id,
    FIRST (session_id OF A) AS session_id,
    FIRST (datestamp OF A) AS first_date,
    LAST (datestamp OF ANY(A,DUP)) AS last_date,
    ACCUMULATE (page OF A) AS page_path,
    ACCUMULATE (page of DUP) AS dup_path)
);