Crystal Reports 中的条件求和 [英] Conditional summation in Crystal Reports

查看:20
本文介绍了Crystal Reports 中的条件求和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些价格和数量的行,我希望仅对数量 > 5 的价格求和

I have some rows with a price and quantity and I'm looking to sum only the prices where the quantity > 5

itemname        price         Qty
----------------------------------
apple            20            2
watermelon       10            3
bango            22            6
hashesh           3            9

鉴于上述数据,我想得到的总和是 22+3=25.我该如何编写一个公式来做到这一点?

Given the above data, the sum I'd like to get is 22+3=25. How do I write a formula to do this?

推荐答案

在数量的一侧创建一个名为calculation的公式字段,并输入以下文本:

create a formula field named calculation to the side of quantity and enter the following text:

// {@calculation}
If quantity>5 then price
else 0

现在取 {@calculation} 的总和.在报告中隐藏这两个细节.

now take the sum of {@calculation}. suppress both detail in the report.

求和并放在所需列的页脚中.

Take the sum and place in the footer of the required column.

这篇关于Crystal Reports 中的条件求和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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