Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
cancel
Showing results for 
Search instead for 
Did you mean: 
Bruno_Basulto
Contributor
Contributor

how to filter data by date in a load script?

Hi all,

I need to filter when performing a data load from an Oracle connection using a date and time field that has the following format:

"FEC_SOL" : '2023-01-01 00:00:00.000000'

to bring only information from 2023 onwards.

Thank you!

Labels (1)
1 Solution

Accepted Solutions
MatheusC
Specialist III
Specialist III

Hi, @Bruno_Basulto 

From the example, it appears to be a datetime field,

Could you do this in Load instead of Select?

see below

load
...
Where year(Date(Floor(datetime)))>=year(today())-1;

[Table];
Select
...
from;

Regarts,
Matheus

Did you find a solution to your question? Mark the solution as accepted ✅ and if you found it useful, press the like button!

View solution in original post

5 Replies
MatheusC
Specialist III
Specialist III

Hi, @Bruno_Basulto 

From the example, it appears to be a datetime field,

Could you do this in Load instead of Select?

see below

load
...
Where year(Date(Floor(datetime)))>=year(today())-1;

[Table];
Select
...
from;

Regarts,
Matheus

Did you find a solution to your question? Mark the solution as accepted ✅ and if you found it useful, press the like button!
MatheusC
Specialist III
Specialist III

Did you get the solution?

Close the topic with the solution met and leave a like if you found it useful.

Thank you!

Did you find a solution to your question? Mark the solution as accepted ✅ and if you found it useful, press the like button!
anat
Master
Master

select * from table where EXTRACT(YEAR FROM datefield) >=year(today())-1

Bruno_Basulto
Contributor
Contributor
Author

Yes! its work!
Thanks.

WaltShpuntoff
Employee
Employee

When you are using the Today function in a load script, you should always use Today(1), since Today() or Today(0) is the date of the last successful reload. If you are doing daily updates this makes a big difference.

For details:

Qlik Help for Today() function 

ws