15,790,267 members
See more:
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")`
Posted
Updated 24-Sep-17 20:33pm
v2

## Solution 2

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

## Solution 1

```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. ```