nPath Function Results Example | Teradata Vantage - nPath Results Example: ACCUMULATE String over 64000 Characters, DISTINCT - Analytics Database

Database Analytic Functions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-04-06
dita:mapPath
gjn1627595495337.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
jmh1512506877710
Product Category
Teradata Vantageā„¢

Input

Input table is banking_web_clicks (see nPath Results Example: ACCUMULATE String over 64000 Characters).

SQL Call

SELECT * FROM nPath (
  ON banking_web_clicks PARTITION BY session_id ORDER BY datestamp
  USING
  Mode (NONOVERLAPPING)
  Pattern ('A*')
  Symbols (TRUE AS A)
  Result (
    FIRST (session_id OF A) AS session_id,
    ACCUMULATE (100000)(DISTINCT page OF A) AS path
  )
) AS dt;

Output

Because ACCUMULATE specifies a size greater than 64000, the data type of the path column is CLOB, even though the length of the value of path is 219.

session_id path
1 [ONLINE STATEMENT ENROLLMENT, CUSTOMER SUPPORT, ACCOUNT HISTORY, VIEW DEPOSIT DETAILS, PROFILE UPDATE, FREQUENTLY ASKED QUESTIONS, FUNDS TRANSFER, BANK STATEMENT, COMPLAINTS, ACCOUNT SUMMARY, HOME PAGE, ADD BENEFICIARY]