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: 
jduenyas
Specialist
Specialist

Set analisys question

Hi All

Is there a difference between:

Count({<OrderValue={"<>0"} >}SalesOrderNumber)

and

Count({<OrderValue-={0} >}SalesOrderNumber)

I am not getting consistent results, depending on where I use either one.

Thanks

 

 

1 Solution

Accepted Solutions
nilaksh92
Partner - Contributor III
Partner - Contributor III

Both are giving correct results as they have made for. 

If depends upon the requirement which need to be used.

if you don't want to consider 0 as well as NULL

then you should go for 

Count({<F1={"<>0"}>}F2)

 

if you need to exclude only 0 then you should go for

Count({<F1-={0}>})F2)

 

Hope this helps.

Thanks

Nilaksh Mahajan

View solution in original post

5 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

The Count({<OrderValue-={0} >}SalesOrderNumber)

is the same as 

 

Count({<OrderValue = {'*'} - {'0'}>} SalesOrderNumber)

(include everything *, but exclude 0; or include everything except 0). 

Besides without '' the formula will be underlined as if it's an error.

 

While using Count({<OrderValue={"<>0"} >}SalesOrderNumber) you exclude 0 and null values from the list of possible OrderValue values.

 Screenshot_1.jpg

Please check the simple attachment file.

 

 

jduenyas
Specialist
Specialist
Author

for your reply, however it is not what I had in mind.

Here is a sample of where the test fails. There are 11 members of F1. One of F2 is NULL and one of F2 is 0.

Seems that the expression :  Count({<F1={"<>0"}>}F2) returns the correct value.

Capture.JPG

jduenyas
Specialist
Specialist
Author

My bad. the description of values in fields F1 and F2 was reversed.

Here is how it should read:

There are 11 members of F2. One of F1 is NULL and one of F1 is 0.

Thanks

nilaksh92
Partner - Contributor III
Partner - Contributor III

Both are giving correct results as they have made for. 

If depends upon the requirement which need to be used.

if you don't want to consider 0 as well as NULL

then you should go for 

Count({<F1={"<>0"}>}F2)

 

if you need to exclude only 0 then you should go for

Count({<F1-={0}>})F2)

 

Hope this helps.

Thanks

Nilaksh Mahajan

jduenyas
Specialist
Specialist
Author

Thanks Nilaksh

It indeed seems this way.

The modifier {<F1={"<>0"}>} indeed removes both 0 and NULL.

It is counter intuitive though.