[英]Using running totals in formulas - Crystal reports
I have created a set of running totals looking for specific fields in a database. 我创建了一组运行总计,以查找数据库中的特定字段。 If these fields are located, a subsequent sum is performed to calculate the total for that field.
如果找到了这些字段,则执行后续总和以计算该字段的总数。 eg Field to Summarise - DB.Field.Value-Sum.
例如,要汇总的字段-DB.Field.Value-Sum。 Evaluate - Use a Formula-Field Name ='1'
评估-使用公式字段名称='1'
This sums the totals for this field. 这是该字段的总计。 The issue is that I have many running totals doing this, and what I want to do is add these together to provide a total for all of these.
问题是我有很多运行总计在执行此操作,而我想要做的是将这些总计加起来以提供所有这些总计。 Currently I have a formula that uses each field with a '+' between each.
目前,我有一个公式,该公式使用每个字段,每个字段之间都带有“ +”。 This appeared to work fine, but when tested against a record where some of these fields are blank, the subsequent formula displays nothing.
这似乎工作正常,但是当针对其中某些字段为空白的记录进行测试时,后续公式未显示任何内容。
Any advise on what I should do here/ am doing wrong? 我在这里应该做什么/做错了什么建议吗?
Thanks 谢谢
It sounds like a null record (empty value) is breaking your running total. 听起来像是空记录(空值)打破了您的运行总计。 You have a few options
您有几种选择
if isnull({Command.Decimal}) then 0 else {Command.Decimal}
Isnull(Tablename.Columnname,0)
- use this in your running total Isnull(Tablename.Columnname,0)
-在运行总计中使用此值 not(isnull({tablename.columnname}))
-- If the record IS null, the running total does not evaluate it. not(isnull({tablename.columnname}))
-如果记录为空,则运行总计不会对其进行求值。 It will be ignored by the running total.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.