Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Set Analysis - NULL Values

Hi,

is it possible to use set - expressions to query for null values?

For example, I would like to express the following formula:

sum ( if (isnull(OrderNumber), Flag)

Thanks,

Gerald

Tags (2)
1 Solution

Accepted Solutions
yblake
Contributor II

Set Analysis - NULL Values

Hello,

I think you need to calculate sum of all flag minus flags with orders :

sum({1-<OrderNumber>=0>} Flag)

or sum(Flag) -sum({<OrderNumber>=0>} Flag)

It returns 3 (10-7) with this script :

test:
load
recno() as Key,
if (mod(recno(),3)=0,null(),recno()) as OrderNumber,
1 as Flag
autogenerate(10);

3 Replies
MVP
MVP

Set Analysis - NULL Values

I believe it's as simple as this:

sum({<OrderNumber={}>} Flag)

That should give you the set of all selected records that are not associated with OrderNumber, which I think is the same as saying you want all selected records where the OrderNumber is null.

yblake
Contributor II

Set Analysis - NULL Values

Hello,

I think you need to calculate sum of all flag minus flags with orders :

sum({1-<OrderNumber>=0>} Flag)

or sum(Flag) -sum({<OrderNumber>=0>} Flag)

It returns 3 (10-7) with this script :

test:
load
recno() as Key,
if (mod(recno(),3)=0,null(),recno()) as OrderNumber,
1 as Flag
autogenerate(10);

Not applicable

Set Analysis - NULL Values

Thanks Smile

Community Browser