Qlik Community

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.

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

Re: COUNT: Error in Expression

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

9 Replies
Not applicable

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

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

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

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

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

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

jmarinesc
New Contributor III

Re: COUNT: Error in Expression

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

Re: COUNT: Error in Expression

Mayil;

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

Community Browser