nPath範囲一致の例: ホームページから開始してページ1を参照するセッションを検索 - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Advanced SQL Engine分析関数

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
2020年6月
Language
日本語
Last Update
2021-03-30
dita:mapPath
ja-JP/mld1565890109978.ditamap
dita:ditavalPath
ja-JP/mld1565890109978.ditaval
dita:id
B035-1206
Product Category
Software
Teradata Vantage

入力

入力テーブルは、LAG式とLEAD式の例: 入力問合わせの別名なしによるaggregate_clicksです。

SQL-MapReduce呼び出し

SELECT * FROM nPath (
  ON aggregate_clicks PARTITION BY sessionid ORDER BY clicktime
  USING
  Mode (NONOVERLAPPING)
  Pattern ('^H.A*.P1.A*')
  Symbols (pagetype='home' AS H, pagetype='page1' AS P1, TRUE AS A)
  Result (
    FIRST (sessionid OF A) AS sessionid,
    ACCUMULATE (pagetype OF ANY(H,P1,A)) AS path
  )
) AS dt ORDER BY dt.sessionid;

出力

sessionid path
1 [home, home1, page1, home, home1, page1, home, home, home, home1, page1, checkout, home, home, home, home, home, home, home, home, home]
2 [home, home, home, home, home, home, home, home, home, home1, page1, checkout, checkout, home, home]
3 [home, home, home, home, home, home, home, home, home1, page1, home, home1, page1, home]
4 [home, home, home, home, home, home, home1, home1, home1, page1, page1, page1]
5 [home, home, home, home, home1, home1, home1, page1, page1, page1, page2, page2, page2, checkout, checkout, checkout, page2, page2, page2]