如何在水晶报告中用另一个场条件计算场? [英] How to count field with another field condition in crystal report ?

查看:134
本文介绍了如何在水晶报告中用另一个场条件计算场?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这样的条件:

----------------

name |股票

A | 0

B | 0

C | 2

D | 1



如何计算字段名称,字段条件库存= 0?



我是什么尝试过:



伯爵({NAME},{STOCK},0)

解决方案

嗨Khabibb,



Count函数不能以这种方式工作。



达到此目的的最简单方法如下:

a)创建一个新的运行总计

b)选择名称字段作为要汇总的字段

c)将摘要类型设置为计数

d)在评估部分中选择使用公式选项

e)将公式设置为是 tableName.Stock = 0 - 选择您要计算的字段

f)在重置从不选项>部分

g)将运行总计添加到报告页脚部分

如果将运行总计添加到组页脚,您将看到总计s tock第一组页脚中第一组中为零的项目,第一组中为零的库存项目总数。第二组中的第二组页脚&等等。

将运行总计添加到报表页脚会在报表末尾显示它。向您显示所有具有零库存号的名称项的总数



亲切的问候


创建运行总计,我们称之为清除:

汇总字段:{name}
摘要类型:计数
评估:选中'使用公式'然后 - > ; x + 2按钮并输入您的代码:

{stock} = 0

重置:选中从不,如果您想要汇总整个报告或
选中更改组并选择要为此计算的组。


condition like this :
----------------
name | stock
A | 0
B | 0
C | 2
D | 1

how to count field name with field condition stock = 0 ?

What I have tried:

Count ({NAME},{STOCK} , "0")

解决方案

Hi Khabibb,

The Count function does not work in this way.

The easiest method of achieving this is as follows;
a) Create a new Running Total
b) Select the Name field as the Field to Summarize
c) Set Type of Summary to count
d) Select the option Use a formula in the Evaluate section
e) Set the Formula to be tableName.Stock = 0 - select the field you want to count
f) Select the option Never in the Reset section
g) Add the Running Total to the Report Footer section
If you add the Running Total to the Group Footer you will see the total of stock items that have a zero in the first group in the first group footer, the total of stock items that have a zero in the first & second in the second group footer & so on.
Adding the Running Total to the Report Footer displays it at the end of the Report & shows you the total of all Name Items that have a Zero stock number

Kind Regards


Create a running total, let's call it 'clear':

Fields to Summarize: {name}
Type of summary: Count
Evaluate: check 'use a formula' then ->x+2 button and enter your code:

{stock} = 0

Reset: check 'Never', if you want to summarize it for a whole report or
check 'On change of group' and select the group you would like to do this calculation for. 


这篇关于如何在水晶报告中用另一个场条件计算场?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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