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: 
jim_chan
Specialist
Specialist

loading script + how to load data with date data only ?

Hi guys ,

I want to load in a data set. there is a date field, some rows of data have a empty/null value. so i do not want to load in those particular rows with the date field data is empty or now??

can i write.

load

ID ,

planned_date

where planned_date <> null() ;

will this where clause work as well???

rgds

Jim

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

It will not return any rows if you use that. Cos Len(Trim(EmptyData)) is always 0 so if you use < 0 the condition fails and it will not return any rows. If you want empty rows to be pulled use = 0. If you dont want to pull empty rows use Len(Trim(plannedDate)) > 0. Hope you got it.

View solution in original post

5 Replies
vishsaggi
Champion III
Champion III

Yes, you can try that or like:

load

ID ,

planned_date

where Len(Trim(planned_date)) > 0 ;

jim_chan
Specialist
Specialist
Author

Thanks Vish,

mind to tell me whats the different???? in short ?

Rgds

Jim

jim_chan
Specialist
Specialist
Author

Dear Vish,

what if i want to load in data rows that has EMPTY date field data?

is it gonna be Len(Trim(planned_date)) < 0 ?

Rgds

Jim

vishsaggi
Champion III
Champion III

Sometimes data is not always null. So if there are any spaces or empty values Trim() will remove those extra spaces and Len() will count if there is any data. If there is a data then Len() will give you the size of that field value. So used Len() > 0 will return all the valid data.

vishsaggi
Champion III
Champion III

It will not return any rows if you use that. Cos Len(Trim(EmptyData)) is always 0 so if you use < 0 the condition fails and it will not return any rows. If you want empty rows to be pulled use = 0. If you dont want to pull empty rows use Len(Trim(plannedDate)) > 0. Hope you got it.