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

Expr ´OK´ But not works for me...

Hello !

I am using:

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

Expr is ´OK´ but I don´t get my result, I get (0) and It must be (5) in One Field

Attached My Ex1.qvw

Tk a Lot in advanced.

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Expr ´OK´ But not works for me...

No, I need to count Fieldn only (if : Field4 ={'-2'} and Field1, Field2, Field3 not equal to {'-1'} or equal to {'-'})


The count of that is 0. There are no records where Field1 has another value than -1 or null. Same for Field2 and Field3.

If you want the count of items where Field4= -2 and Field1,Field2 and Field3 are null, try this:

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

Inline load cannot produce nulls. Your inline load creates strings '-' instead of nulls. That's why your expression does work with the inline load.


talk is cheap, supply exceeds demand
5 Replies
MVP & Luminary
MVP & Luminary

Re: Expr ´OK´ But not works for me...

Is this what you're looking for?

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


talk is cheap, supply exceeds demand
jmarinesc
New Contributor III

Re: Expr ´OK´ But not works for me...

Hello;

No, I need to count Fieldn only (if : Field4 ={'-2'} and Field1, Field2, Field3 not equal to {'-1'} or equal to {'-'})

Regards

JMC

jmarinesc
New Contributor III

Re: Expr ´OK´ But not works for me...

Hello! QViewComm

If I try With INLINE data: It works, but not with (Load QVD or Load Xlsx) Attached Ex2.qvw

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

LOAD * INLINE [

   Fieldn, Field1, Field2, Field3, Field4

   1789,-,-1,-1,-2

   1790,-,-1,-1,-2

   1791,-,-1,-1,-2

   201006021,-,-1,-1,-2

   201006021,-,-1,-1, -2

   1790,-,-,-1,-2

   201006011,-,-,-,-1,-2

   201006011,-,-,-,-1,-2

   201006023,-,-,-,-1,-2

   201006023,-,-,-,-1,-2

   1789,-,-1,-1,-2

   1592380.1,-,-, -1,-2

   1592381.1,-,-,-1,-2

   1592382.1,-,-,-1,-2

   1592383.1,-,-,-1,-2

   1521600,-,-,-,-2

   1521601,-,-,-,-2

   1521602,-,-,-,-2

   1521722,-,-,-,-2

   1521723,-,-,-,-2

   20720003,-,-,-1,-  

   20720004,-,-,-1,-  

   20720005,-,-,-1,- 

   20720006,-,-,-1,-  

   20720007,-,-,-1,-  

   20882087,-,-,-1,-  

   20882088,-,-,-1,-  

   20882089,-,-,-1,- 

   20882090,-,-,-1,-  

   20882091,-,-,-1,-  

   1047610946,-1,-1,-1,-2

   1047610950,-1,-1,-1,-2

   LTO1006102ET001,-1,-1,-1,-2

   MEX1006101ED001,-1,-1,-1,-2

   TIJ1006102ET001,-1,-1,-1,-2

];

But with:

Test:

LOAD *

FROM

(ooxml, embedded labels); 

It Doesn´t work.

Tk Tk Tk

MVP & Luminary
MVP & Luminary

Re: Expr ´OK´ But not works for me...

No, I need to count Fieldn only (if : Field4 ={'-2'} and Field1, Field2, Field3 not equal to {'-1'} or equal to {'-'})


The count of that is 0. There are no records where Field1 has another value than -1 or null. Same for Field2 and Field3.

If you want the count of items where Field4= -2 and Field1,Field2 and Field3 are null, try this:

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

Inline load cannot produce nulls. Your inline load creates strings '-' instead of nulls. That's why your expression does work with the inline load.


talk is cheap, supply exceeds demand
jmarinesc
New Contributor III

Re: Expr ´OK´ But not works for me...

Gysbert!!!

It works!      Thanks a lot!   I appreciate it!

JMC

Community Browser