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: 
erku
Partner - Contributor II
Partner - Contributor II

How use where clause for isodate field during load from mongodb

Hi,

I've tried to load and filter out isodate field from mongodb but I got a lot of trouble.
I use:
Load
a,
date
;
select
*
from tab1 where date<='2021-01-27T12:24:30.000Z'
but it doesn't work, it can't recognize '<='. If I use like statement: from tab1 where date<='2021-01-27%' it's working correctly. Why this timestamp is a string and how use <= and put proper type of date?
Could anyone help me?

3 Replies
Anil_Babu_Samineni

Try this?

Load a,
date where ConvertToLocalTime(date)<=ConvertToLocalTime('2021-01-27T12:24:30.000Z');
select * from tab1;

 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
erku
Partner - Contributor II
Partner - Contributor II
Author

Hi,

Yes it's working but looks like first it loads all data and then filter it out and loading takes a lot of time. Maybe it's some kind of performance issue. For example filtering one date:
where ConvertToLocalTime(date)=ConvertToLocalTime('2021-01-27T12:24:30.000Z')
takes 20 min. Any idea why?

Anil_Babu_Samineni

When you say 20 minutes, how many records are there?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful