Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If condition in where clause during data load

Hi all,

I have a data set with the following sttucture

TypeDateValue
A1/1/200110
A2/2/200120
B15
B90
A70

The Data is such that Type B will always have null in Date Column. While loading the data, I need to filter all values where Date is null for Type A. In this case, I should not load the last row. How can I achieve this while loading the script? Any help?

I tried the below and it doesn't seem to work:

where ( if([Type]='A', [Date]>0));

1 Solution

Accepted Solutions
maxgro
MVP
MVP

(Type = 'A' and len(trim(Date))>0) or Type='B'

View solution in original post

6 Replies
maxgro
MVP
MVP

to get records with Type = 'A' and Date not null you can use len(trim(.....))

load

     ....

from

     .....

where

     Type = 'A' and len(trim(Date))>0

     ;

Not applicable
Author

But I would also like to keep records where Type='B' and date will be null for them

maxgro
MVP
MVP

(Type = 'A' and len(trim(Date))>0) or Type='B'

robert99
Specialist III
Specialist III

Could you use <>

where

Type <> ('A' and len(trim(Date))>0))

MarcoWedel

Where not (Type='A' and IsNull(Date))

MarcoWedel

Where Type<>'A' or not IsNull(Date)