在Pentaho水壶中应用数据透视 [英] Applying Pivot in Pentaho Kettle
问题描述
我正在使用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:
在billingid
和sku_id
上排序,然后在sum
qty
上排序,按billingid
和sku_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屋!