Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
nicolai_moller
New Contributor

Flag for nulls

Hi

How do I create a flag that gives me every person who doesn't have any start or end dates (both must be empty)?

The table below, should only return Person 2, as there are zero dates on that person.

Thanks.

PersonStartEndWhatever_ID
101-01-201502-01-201510
304-04-201511
112
213
214
1 Solution

Accepted Solutions

Re: Flag for nulls

Try this:

Table:

LOAD Person,

    Date#(Start, 'MM-DD-YYYY') as Start,

    Date#(End, 'MM-DD-YYYY') as End,

    Whatever_ID

FROM

[https://community.qlik.com/thread/165746]

(html, codepage is 1252, embedded labels, table is @1);

Join(Table)

LOAD Person,

  If(Sum(Start) = 0 and Sum(End) = 0, 1, 0) as Flag

Resident Table

Group By Person;

View solution in original post

2 Replies

Re: Flag for nulls

Try this:

Table:

LOAD Person,

    Date#(Start, 'MM-DD-YYYY') as Start,

    Date#(End, 'MM-DD-YYYY') as End,

    Whatever_ID

FROM

[https://community.qlik.com/thread/165746]

(html, codepage is 1252, embedded labels, table is @1);

Join(Table)

LOAD Person,

  If(Sum(Start) = 0 and Sum(End) = 0, 1, 0) as Flag

Resident Table

Group By Person;

View solution in original post

buzzy996
Honored Contributor II

Re: Flag for nulls

use the if condition on ur start ans end date wherever the values are null u can put ur flag else the source date.