在Pentaho水壶中应用数据透视 [英] Applying Pivot in Pentaho Kettle

查看:99
本文介绍了在Pentaho水壶中应用数据透视的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用pentaho水壶5.2.0版本.我正在尝试对源数据进行透视,这是源的结构

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

这就是我所期望的

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

任何帮助将不胜感激..提前感谢

Any help would be much appreciated ..THANKS in advance

推荐答案

要使denormaliser起作用,首先必须对行"进行排序,然后对行进行分组,以得到sum of qty.因此,转换将如下所示:

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:

billingidsku_id上排序,然后在sum qty上排序,按billingidsku_id分组:

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

然后在denomaliser中,您需要列出每个不同的sku_id,以创建列pr id.

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

这将提供预期的输出:

这篇关于在Pentaho水壶中应用数据透视的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆