Crystal Report SUM 函数与 CASE [英] Crystal Report SUM function with CASE

查看:17
本文介绍了Crystal Report SUM 函数与 CASE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的水晶报表中有以下列值:

I have the following column values in my crystal report:

|Code |Unit |
|A    |2    |
|B    |3    |
|C    |2    |
|D    |3    |
|E    |1    |
|F    |1    |
|G    |4    |
|H    |(3)  |

我想总结除具有代码 H、J、K 和 L 的单元之外的单元.代码:H、J、K 和 L 包含带括号的单位.有没有办法做到这一点?

I want to summarize the Unit except the Units which has Code H,J,K, and L. The Codes: H,J,K, and L contains units which has parenthesis. Is there a way to do this?

推荐答案

如果你只想省略带有'('的单位,只需将此字段转换为数字使用

If you want to omit only units with ‘(‘ in it just convert this filed to number Use

Val ({Unit}) 

这将返回 0 用于非数字文本和数字创建这些数字的总和,你会得到你想要的

this will return 0 for non-numeric text and number for numeric create sum of these you will get what you want

如果你不想使用任何特殊的,那么创建这样的公式字段

If you want not to use any special then create formula field like this

if {fa_rep_vr_Main.CustomTitle} not in('A','B','C') then
    0
else
    val({Unit})

使用总和

如果您想要 NewPriceAD 的总和,请在管理字段中使用它

If you want sum of NewPriceAD then use it in mentained field

这篇关于Crystal Report SUM 函数与 CASE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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