Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SQL select by year

hi, i have a small problem

usually, the whole oracle DB is loaded in a QVD container.

Now, data should be loaded incrementally, so the range of time to be loaded, has to be limited.

DBconsum:

LOAD *;

SQL SELECT * FROM MYDB."consumption_s"

WHERE year(TIME)= 2012 and month(TIME) = 5

;

STORE DBconsum INTO $(vQVDStore)consumption_s_inc.QVD;

usually, that would be no big deal, its very basic sql.

the timestamp (TIME) has the format "41091,083333333" , which is usually readable by qlikview as "01.07.2012 02:00:00" or just "2012".

but it doesnt seem to work with this sql load.

any suggestions ?

7 Replies
etl_tools
Creator
Creator

Do you really need a time part?

May be you can just remove it?

Mike

Not applicable
Author

etl_tools wrote:

Do you really need a time part?

May be you can just remove it?

Mike

hi mike, im not really understanding your reply. what do you mean by "remove" ?

the TIME field is needet, otherwise, the data makes no sense.

how else is it possible to select, which months to load ?

etl_tools
Creator
Creator

01.07.2012 02:00:00

01.07.2012 <= Date part

02:00:00    <= Time Part (Do you use it in your dashboard?)

Which database do you work with?

Is it Oracle, MySQL ETC

Mike


Not applicable
Author

an oracle DB is used.

all parts of the timestamp are used in the dashboard, but that doesnt matter during load.

i have to load the TIME field (content= "41091,083333333"), get the year, month, and load only record from a certain month in 2012.

MayilVahanan

Hi

Try like this

DBconsum:

LOAD * WHERE year(TIME)= 2012 and month(TIME) = 'May';

SQL SELECT * FROM MYDB."consumption_s";

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
etl_tools
Creator
Creator

As a test can you try the following SQL to see if it works

DBconsum:

LOAD *;

SQL SELECTcast(TIME AS varchar2(40) ) as TIME

FROM MYDB."consumption_s"

WHERE year(TIME)= 2012 and month(TIME) = 5;

STORE DBconsum INTO $(vQVDStore)consumption_s_inc.QVD;

Mike

QlikView connector which works with 28 datasources and has 300 + validation functions

http://www.etl-tools.com/etl-tools/qlikview-connector/overview.html


etl_tools
Creator
Creator

Alexander

I probably misunderstood you.

Are you saing that when you try to load the data the script fails with error?

Or the sql does not return any data?

Mike