5 Replies Latest reply: Mar 19, 2018 2:21 PM by Sasidhar Parupudi

# Count field including zeros

Hi,

I have two columns as shown below

Name  Value

A           0

A           1

A           2

B           0

B           1

How can I count the value field including zeros? Count(Value) for A should be 3 (0,1,2 - three occurrences) and count(value) for B should be 2 (0,1 - as two occurrences)

• ###### Re: Count field including zeros

Should be just Count(Name) or Count(Value)

• ###### Re: Count field including zeros

Simple count, you can use Count(Value)  or Count(Name)

If you want NULL count also

=NullCount(Value)+Count(Value)

• ###### Re: Count field including zeros

Hi,

tmp:
If(peek('Name')=Name, peek(Value)+1, 0)  AS Value;
[
Name
A
A
A
B
B

]
;

• ###### Re: Count field including zeros
 Name Date Value ID A 1/1/2017 0 Ax A 1/1/2017 0 Ay A 1/1/2017 1 Az B 1/1/2017 0 Bx B 1/1/2017 1 By B 1/2/2017 0 Bz The Count of Value should give me 5(0 for A (1/1/2017), 1 for A (1/1/2017), 0 for B (1/1/2017), 1 for B (1/1/2017), 0 for B (1/2/2017)