Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
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.

Tags (2)
1 Solution

Accepted Solutions
Highlighted
Honored Contributor III

Re: Null flag

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
Highlighted
Honored Contributor II

Re: Null flag

Hi,

Try Below Code:

SuperiorIndicatorTemp:

Load SuperiorIndicator,

EQUNR,

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

RESIDENT SCD;

HTH

sushil

Highlighted
Partner
Partner

Re: Null flag

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

Highlighted
Honored Contributor III

Re: Null flag

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

Highlighted
Not applicable

Re: Null flag

That was it. Thanks Anbu.

Highlighted
Honored Contributor III

Re: Null flag

SuperiorIndicatorTemp:

Load SuperiorIndicator,

EQUNR,

1 as SuperiorIndicatorFlag

Resident SCD

Where Len(SuperiorIndicator) = 0

;

InnerJoin (Equipment)

Load EQUNR,

SuperiorIndicatorFlag

Resident SuperiorIndicatorTemp

;

Drop Table SuperiorIndicatorTemp

;