Create the FrequentPaths Input Table - Aster Analytics

Teradata Aster® Analytics Foundation User GuideUpdate 2

Product
Aster Analytics
Release Number
7.00.02
Published
September 2017
Language
English (United States)
Last Update
2018-04-17
dita:mapPath
uce1497542673292.ditamap
dita:ditavalPath
AA-notempfilter_pdf_output.ditaval
dita:id
B700-1022
lifecycle
previous
Product Category
Software

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)
    Mode (NONOVERLAPPING)
  )
);

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]