Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for
Did you mean:
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
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

5 Replies
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.

Please check the simple attachment file.

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.

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

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

Specialist
Author

Thanks Nilaksh

It indeed seems this way.

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

It is counter intuitive though.

Community Browser