9 Replies Latest reply: Dec 5, 2012 11:18 AM by Jaime Marines

# COUNT: Error in Expression

Hi!

I need to count Fieldn..only if field1 =-2 and field2 <> -1 and field3 <> -1 and field4 <> -1 ...then I get Error in expression..Tk in advanced.

COUNT (IF(Field1='-2' ,Field2<>'-1' ,Field3<>'-1' ,Field4<>'-1'),Fieldn)

JMC

• ###### Re: COUNT: Error in Expression

Try this

COUNT ({\$<Field1={-2} ,Field2-={-1} ,Field3-={-1} ,Field4-={-1}>}Fieldn)

• ###### Re: COUNT: Error in Expression

HI

Try like this

COUNT ({<Field1={-2} ,Field2-={-1} ,Field3-={-1} ,Field4-={-1}>}Fieldn)

Hope it helps

• ###### Re: COUNT: Error in Expression

Hello: This is an ex.           The result must be 444 and these expr are counting something else...Tks.

 Fieldn Field1 Field2 Field3 Field4 222 -2 -1 -1 -1 222 -2 -1 -1 222 -2 -1 222 -2 -1 -1 222 -2 -1 222 -2 -1 222 -2 -1 -1 222 -2 222 -2 444
• ###### Re: COUNT: Error in Expression

Sorry ....The result must be     2   I am using count not sum

• ###### Re: COUNT: Error in Expression

HI

Try

COUNT ({<Field1={'-2'} ,Field2-={'-1'} ,Field3-={'-1'} ,Field4-={'-1'}>}Fieldn)

Edit:

PFA

Hope it helps

• ###### Re: COUNT: Error in Expression

Mayil;

• If I use this expr: I got 0

COUNT({<ESSIMATCH={'-2'} ,ESNOMATCH-={'-1'} ,ESNOMATCH1-={'-1'} ,ESNOMATCH2-={'-1'}>}ESremision)

• If I use below one: I got Partially my count but is including all registers that contains (-2) in field ESSIMATCH and I need only (-2) in ESSIMATCH and blanks or nulls in other fields.

count({<ESNOMATCH={''}>+< ESNOMATCH1={''}>+<ESNOMATCH2={''}>+<ESSIMATCH={'-2'}>} ESremision)

• ###### Re: COUNT: Error in Expression

Hi

Did u check the demo, its work fine for me. Can u post a sample data in csv or sample post?

for include the null value alone, u can use like this

{<ESNOMATCH-={'*'}>}

Hope it helps

• ###### Re: COUNT: Error in Expression

Mayil;

but with my expr..doesn´t work.

How can I attach some data that I am using? , Tk in advanced!

COUNT ({<ESSIMATCH={'-2'} ,ESNOMATCH-={'-1'} ,ESNOMATCH1-={'-1'} ,ESNOMATCH2-={'-1'}>}ESremision)

JMC

• ###### Re: COUNT: Error in Expression

Mayil;

I have been attached my QVW....Tk in adv.