zoukankan      html  css  js  c++  java
  • PDI的steps:(6:Analytic Query)

    Description

    This step allows you to peek forward and backwards across rows. Examples of common use cases are:

    • Calculate the "time between orders" by ordering rows by order date, and LAGing 1 row back to get previous order time.
    • Calculate the "duration" of a web page view by LEADing 1 row ahead and determining how many seconds the user was on this page.

    Options

    The following table provides a description of the options available for the Analytic Query step:

    OptionDescription
    Step name Name of the step; this name has to be unique in a single transformation
    Group fields table Specify the fields over which you want to group. Click Get Fields to add all fields from the input stream(s). The step will do no additional sorting, so in addition to the grouping identified (ie, CUSTOMER_ID) here you MUST also have the data sorted (ORDER_DATE)
    Analytic Functions table Specify the analytic functions to be solved.
    • New Field Name - the name you want this new field to be named on the stream (PREV_ORDER_DATE)
    • Subject - The existing field to grab (ORDER_DATE)
    • Type - A type of analytic function
    • N - The number of rows to offset (backwards or forwards)

    Here are the available analytic functions :

    • Lead - Go forward N rows and get the value of Subject
    • Lag - Go backward N rows and get the value of Subject |

    Examples

    These are the examples that are available in our distribution:

    samples/transformations/Analytic Query - Lead One Example.ktr
    samples/transformations/Analytic Query - Random Value Example.ktr
    

    
    
  • 相关阅读:
    js学习笔记
    在 Windows 下远程桌面连接 Linux XManager 篇
    使用多种反病毒引擎扫描文件
    光纤接口小知识
    在 Windows 下远程桌面连接 Linux VNC 篇
    基于 RHEL 的 CentOS 5.5 发布
    安装Windows 7的XP模式的步骤
    跨平台加密版 SQLite 3 wxSQLite3
    Free 的迷思
    使用 iptables 限制黑客猜密码
  • 原文地址:https://www.cnblogs.com/aomi/p/3096729.html
Copyright © 2011-2022 走看看