Create the FrequentPaths Input Table - Aster Analytics

Teradata Aster Analytics Foundation User Guide

Product
Aster Analytics
Release Number
6.21
Published
November 2016
Language
English (United States)
Last Update
2018-04-14
dita:mapPath
kiu1466024880662.ditamap
dita:ditavalPath
AA-notempfilter_pdf_output.ditaval
dita:id
B700-1021
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]