Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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;

 

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)