Applying Pivot in Pentaho Kettle

烂漫一生 提交于 2019-12-24 13:55:43

问题


I'm using pentaho kettle 5.2.0 version. I'm trying to do pivots on my source data,here it is the structure of my source

Billingid   sku_id    qty
  1           0        1
  1           0        12
  1           0        6
  1           0        1
  1           0        2
  1           57       2
  1          1430      1
  1          2730      1
  2          3883      2
  2          1456      1
  2          571       9
  2          9801      5
  2          1010      1

And this is what I'm Expecting

billingid   0   57  1430  2730  3883  1456  571  9801  1010
   1                *******sum of qty******
   2

Any help would be much appreciated ..THANKS in advance


回答1:


For denormaliser to work, you first have to Sort, and the Group the rows, to have the sum of qty. So the transformation is going to look something like this:

Sort on billingid and sku_id, and then sum the qty, group by billingid and sku_id:

Then in denomaliser you need to list each different sku_id, to make a column pr id.:

This will give the expected output:



来源:https://stackoverflow.com/questions/35646893/applying-pivot-in-pentaho-kettle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!