挖掘实战经验
这回砖家可是真刀真枪开挖了..涉及商业问题,不便多说.他们的dressing code很活泼,牛仔裤+T榭就可以
1:我的思路:宽表可以用Derive节点(still from per item per line's transaction table):
推出一系列衍生fields: ProdType1 Prodtype1Qty ProdTyp2 Prodtype2Qty
1 8 0 0
0 0 1 2
然后再aggregate, sum(PT1), sum(PT1_QTY)
实际操作:用Decode(FieldName, value want to measure, 1 ,0) as ProdType1
外加sum(qty)/ count(distinct Tx_ID)等来统计平均每交易的数量等,SQL末尾是group by新的聚集主键(CUST_ID)
CUST_ID分两种,要么来自CUST_REF, or CARD_NUM, also use a flag to indicate the source.
1:我的思路:宽表可以用Derive节点(still from per item per line's transaction table):
推出一系列衍生fields: ProdType1 Prodtype1Qty ProdTyp2 Prodtype2Qty
1 8 0 0
0 0 1 2
然后再aggregate, sum(PT1), sum(PT1_QTY)
实际操作:用Decode(FieldName, value want to measure, 1 ,0) as ProdType1
外加sum(qty)/ count(distinct Tx_ID)等来统计平均每交易的数量等,SQL末尾是group by新的聚集主键(CUST_ID)
CUST_ID分两种,要么来自CUST_REF, or CARD_NUM, also use a flag to indicate the source.
1 Comments:
(*^__^*) 嘻嘻……
Post a Comment
<< Home