# New to QlikView

Discussion board where members can get started with QlikView.

Announcements

#### Breathe easy -- you now have more time to plan your next steps with Qlik! QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

New Contributor III

## 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

1 Solution

Accepted Solutions
New Contributor III

## 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

9 Replies
Not applicable

## Re: COUNT: Error in Expression

Try this

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

MVP

## Re: COUNT: Error in Expression

HI

Try like this

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

Hope it helps

New Contributor III

## 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
New Contributor III

## Re: COUNT: Error in Expression

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

MVP

## Re: COUNT: Error in Expression

HI

Try

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

Edit:

PFA

Hope it helps

New Contributor III

## 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)

MVP

## 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

New Contributor III

## 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

New Contributor III

## Re: COUNT: Error in Expression

Mayil;

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