Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Null flag

Hi,

I am creating a Flag that looks at another column, and if it is Null, set it as 1 in the flag. (If SuperiorIndicator is null, set SuperiorIndicatorFlag to 1.)

Here is my code:

SuperiorIndicatorTemp:

Load SuperiorIndicator,

EQUNR,

1 as SuperiorIndicatorFlag

Resident SCD

Where Len(SuperiorIndicator) = 0

;

Left Join (Equipment)

Load EQUNR,

SuperiorIndicatorFlag

Resident SuperiorIndicatorTemp

;

Drop Table SuperiorIndicatorTemp

;

Any help would be greatly appreciated.

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

If you don't have matching EQUNR, then still you will get nulls in SuperiorInidcatorFlag.

Left Join (Equipment)

Load EQUNR,

SuperiorIndicatorFlag

Resident SuperiorIndicatorTemp

View solution in original post

5 Replies
sushil353
Master II
Master II

Hi,

Try Below Code:

SuperiorIndicatorTemp:

Load SuperiorIndicator,

EQUNR,

if(ISNULL(SuperiorIndicatior),1,0) as SuperiorInidcatorFlag

RESIDENT SCD;

HTH

sushil

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi,

please check  below code

.I hope it help to u

SuperiorIndicatorTemp:

Load SuperiorIndicator,

EQUNR,

1 as SuperiorIndicatorFlag

Resident SCD

Where Len(SuperiorIndicator) = 0 or isnull(SuperiorIndicator)

;

Left Join (Equipment)

Load EQUNR,

SuperiorIndicatorFlag

Resident SuperiorIndicatorTemp

;

Drop Table SuperiorIndicatorTemp

anbu1984
Master III
Master III

If you don't have matching EQUNR, then still you will get nulls in SuperiorInidcatorFlag.

Left Join (Equipment)

Load EQUNR,

SuperiorIndicatorFlag

Resident SuperiorIndicatorTemp

Not applicable
Author

That was it. Thanks Anbu.

sujeetsingh
Master III
Master III

SuperiorIndicatorTemp:

Load SuperiorIndicator,

EQUNR,

1 as SuperiorIndicatorFlag

Resident SCD

Where Len(SuperiorIndicator) = 0

;

InnerJoin (Equipment)

Load EQUNR,

SuperiorIndicatorFlag

Resident SuperiorIndicatorTemp

;

Drop Table SuperiorIndicatorTemp

;