在pentaho或Javascript中每行添加2分钟

时间:2019-06-24 13:53:42

标签: javascript pentaho pentaho-data-integration

我有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

1 个答案:

答案 0 :(得分:0)

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

  1. 如果传入数据未按波动相位排序,则使用Sort rows步骤根据波动相位进行排序

  2. 对数据进行排序,添加Add value fields changing sequence步骤,并为结果字段命名,为0命名Start at Value,为{{ 1}},并在2中,将波相位值更改为初始序列

  3. 添加Increment by步骤并使用计算FieldCalculator将是emailSchedular,而Date A + B Minutes将是您在上一个字段中输入的结果字段的名称并为Field A

  4. 指定适当的名称

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