Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jmarinesc
Contributor III
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
jmarinesc
Contributor III
Contributor III
Author

Mayil;

I have been checked your demo already and it works fine....

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

View solution in original post

9 Replies
Not applicable

Try this

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

MayilVahanan

HI

Try like this

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

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
jmarinesc
Contributor III
Contributor III
Author

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

FieldnField1Field2Field3Field4
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
jmarinesc
Contributor III
Contributor III
Author

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

MayilVahanan

HI

Try

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

Edit:

PFA

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
jmarinesc
Contributor III
Contributor III
Author

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)

MayilVahanan

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

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
jmarinesc
Contributor III
Contributor III
Author

Mayil;

I have been checked your demo already and it works fine....

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

jmarinesc
Contributor III
Contributor III
Author

Mayil;

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