7.00.02 - Create the FrequentPaths Input Table - Aster Analytics

Teradata Aster® Analytics Foundation User GuideUpdate 2

Aster Analytics
Release Number
September 2017
Content Type
Programming Reference
User Guide
Publication ID
English (United States)
Last Update

The nPath function populates the FrequentPaths input table with sequences that start with "A" and end with "C", using the Accumulate argument to output the full sequence.

CREATE VIEW nPath_output AS (
  SELECT * FROM npath (
    ON sequence_table PARTITION BY id ORDER BY datestamp
    Pattern ('itemA.itemAny*.itemC')
    Symbols (item='A' AS itemA, item='C' AS itemC, TRUE AS itemAny)
    Result (FIRST(id OF itemA) AS id,
    Accumulate (item OF ANY(itemA, itemAny, itemC)) AS path)

This query returns the following table:

SELECT * FROM nPath_output ORDER BY id;
FrequentPaths Example 7 nPath Output Table
id path
1 [A, B, C]
3 [A, D, C]