Fetching the max value from ROWS in pentaho

2019-09-17 20:00发布

I have a table structure

ID  Col_1  col_2  col_3  col_4
1    34     23     45     32
2    20     19     67     18
3    40     10     76     86

I here want the max value from col_1,col_,col_3,col_4 so my output looks like

 ID   Col_1   col_2  col_3  col_4  max
    1    34     23     45     32   45
    2    20     19     67     18   67 
    3    40     10     76     86   86

any help would be much appreciated.

2条回答
Viruses.
2楼-- · 2019-09-17 20:21

You can use Memory Group By or Group By steps in Pentaho. Use the aggregation method as "Maximum" based on your grouping id.

查看更多
该账号已被封号
3楼-- · 2019-09-17 20:32

Use a Modified Java Script Value step with the following code:

var max = Math.max(col_1,col_2,col_3,col_4);
查看更多
登录 后发表回答