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
    

    
    
  • 相关阅读:
    数组方法总结
    CSS3总结
    关于h5的一些知识整理
    如何去掉iview里面的input,button等一系列标签自带的蓝色边框
    CSS隐藏多余的文字
    百度搜索之历史搜索记录~
    transform相关~
    有关数组的相关知识~~
    [Javascript]js中所学知识点回顾总结
    js_随即生成多位验证码及变换颜色
  • 原文地址:https://www.cnblogs.com/aomi/p/3096729.html
Copyright © 2011-2022 走看看