英文:
Pentaho - Sum of a Column based on a Column Condition
问题
需要添加2列,根据操作代码条件精确求和相应列
示例:操作损失(操作代码为30和25的成本列求和)
库存损失(操作代码为26和28的成本列求和)
尝试使用公式和流查找。
英文:
I need to add 2 columns that sum the exactly column based on operational code condition
Example: operational_loss ( sum of cost column with operational code 30 and 25)
inventory_loss (sum of cost column with operational code 26 and 28)
Tried with Formulas and Stream Lookup
答案1
得分: 1
你尝试过使用"分组"吗?您可以按操作码分组,并为每个操作码的值添加成本列。在此之前,您可以使用值映射器将所有不同的操作码映射到所需的分组。
英文:
Did you try a group by? You group by operational code and add the cost column for each value of the operational code. You can use a value mapper before that to map all different operational codes to the desired group.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论