【问题标题】:Add 2 minutes in each rows in pentaho or Javascript在 pentaho 或 Javascript 中每行添加 2 分钟
【发布时间】:2019-06-24 13:53:42
【问题描述】:

我有 3 波相位的数据列表,例如

id      email               emailSchedular          wave phase
1       xyz@gmail.com       2019-06-21 08:00:00         1
2       abc@gmail.com       2019-06-21 08:00:00         1

3       pqr@gmail.com       2019-06-21 08:00:00         2
4       lmn@gmail.com       2019-06-21 08:00:00         2
5       yml@gmail.com       2019-06-21 08:00:00         2

6       wqy@gmail.com       2019-06-21 08:00:00         3
7       pol@gmail.com       2019-06-21 08:00:00         3

我使用的是 pentaho 7.1 版本。

如何在每个波浪阶段增加 2 分钟。

预期输出

id      email               emailSchedular          wave phase
1       xyz@gmail.com       2019-06-21 08:00:00         1
2       abc@gmail.com       2019-06-21 08:02:00         1

3       pqr@gmail.com       2019-06-21 08:00:00         2
4       lmn@gmail.com       2019-06-21 08:02:00         2
5       yml@gmail.com       2019-06-21 08:04:00         2

6       wqy@gmail.com       2019-06-21 08:00:00         3
7       pol@gmail.com       2019-06-21 08:02:00         3

谢谢。

enter image description here

【问题讨论】:

    标签: javascript pentaho pentaho-data-integration


    【解决方案1】:

    您可以通过以下步骤实现:

    1. 如果传入的数据没有按波相位排序,则使用Sort rows步骤按波相位排序

    2. 对数据进行排序添加Add value fields changing sequence 步骤并为结果字段命名,为Start at Value 提供0,为Increment by 提供2,在Field 中提供如果值发生变化,则波相位作为初始序列

    3. 添加 Calculator 步骤并使用计算 Date A + B MinutesField A 将是 emailSchedular 和 Field B 将是您在上一步中提供的结果字段的名称,并为New field

    Screen Shot of the Transformation with each step and output for the same

    【讨论】:

    • #Manu N Shirur,非常感谢您的重播,我通过使用添加序列实现了这一点,然后我使用了修改后的 javascript 值
    • 我已经更新了描述,请点击enter image description here链接
    猜你喜欢
    • 2018-05-05
    • 1970-01-01
    • 2021-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-10
    • 1970-01-01
    相关资源
    最近更新 更多