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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

incremental load from sql database

Dear members of the Qlikview community,

I’m sorry to bother you and I already thank you.

I’ve a problem with my Qlikview application (the data comes from a SQL server management 2008/odbc database).

I would like to execute the application in live, and, thus, I need to realize incremental reloads : use qvd files with a simple add from the SQL database.

As I read on the Qlikview Manual Book, I added 2 variables (example for the reload of a table).

set DCX=Now();

….

Cotation:
Load autonumber(INFO&DATE_ID_T3) as Cotation_ID,*;
LOAD year(DATE)*10000 + month(DATE)*100 + day(DATE) as [DATE_ID_T3],*;
SQL SELECT *
FROM DBPRICING.dbo.HCOT where DATE>#
$(MDX)# and DATE<#$(DCX)#;
concatenate load * from Cotation.qvd (qvd);

set MDX=Now();

However, I encounter an error: (scriperror.jpg the joined file…)

I’ve done a lot of tests but I got errors because of this part:

DATE>#$(MDX)# (I’ve tested without the # or with today() instead of now() )

But it works with DATE>Floor(CAST(GETDATE() AS float));

But it’s not suitable for me because I need a Year-Month-Day-Hour-Minute-Second format.

PS: In my SQL database, the date is in this format:

2013-12-10 16:45:50.013

Thanks,

Yoel

Labels (1)
18 Replies
Not applicable
Author

can u post sample data.

Not applicable
Author

Of course

DATEINFOOPTSTRIKE1M1Y2M1Y3M1Y6M1Y9M1Y1Y1Y18M1Y2Y1Y3Y1Y4Y1Y5Y1Y7Y1Y
2013-12-09 15:43:48.153ALPHA    001.0381.5911.2271.3821.551.5441.6341.6791.5751.5361.4381.241
2013-12-10 16:45:50.013RHO      000.370.360.360.360.360.360.340.320.320.320.30.26
2013-12-10 16:45:50.033NU        000.640.6350.630.620.60.590.580.460.440.350.310.32
2013-12-10 17:51:00.550PRICE    006.510.410.217.325.232.249.573.1108.9137.7154.4177.9
2013-12-10 17:51:00.670NVOL      0028.431.925.730.736.540.55165.38088.188.786.8

thank you!

Not applicable
Author

I meant the document

Not applicable
Author

But i can see in your DATE you have more than YYYY-MM-DD HH:MM:SS you also have miliseconds:

try this:

=timestamp(now(), 'YYYY-MM-DD HH:MM:SS.fff')

Not applicable
Author

here is my script

//==========================

// Génération du calendrier

//==========================

LET DCX= Date(Floor(timestamp(now(), 'MM-DD-YYYY HH:MM:SS')),'YYYY-MM-DD HH:MM:SS');

LET MDX=Date(Floor(timestamp(now(), 'MM-DD-YYYY HH:MM:SS')),'YYYY-MM-DD HH:MM:SS');

load * from CALENDRIER.qvd (qvd)where [Date] <=today();

Cotation:

Load autonumber(INFO&DATE_ID_T3) as Cotation_ID,*;

LOAD year(DATE)*10000 + month(DATE)*100 + day(DATE) as [DATE_ID_T3],*;

SQL SELECT *

FROM DBPRICING.dbo.HCOT where DATE>'$(MDX)';

concatenate load * from Cotation.qvd (qvd);

TMP:

CrossTable(COMPO, DATA, 6)

LOAD *

resident Cotation;

Zscore:

load *, autonumber(Info_Zscore&DATE_ID_ZS) as Zscore_ID;

load

  COMPO,

    right(COMPO, len(COMPO)-FindOneOf(COMPO , 'M%Y' ) ) as [COMPF],

  left(COMPO, FindOneOf(COMPO , 'M%Y' ) ) as [COMPD],

  DATA,

  INFO as Info_Zscore,

  DATE as DATE_zc,

  year(DATE)*10000 + month(DATE)*100 + day(DATE) as [DATE_ID_ZS]

resident TMP;

drop table TMP;

thank you

Not applicable
Author

right, but you used Floor (do it is not a problem) no?

Date(Floor(timestamp(now(), 'MM-DD-YYYY HH:MM:SS')),'YYYY-MM-DD HH:MM:SS')


thanks

Not applicable
Author

no try without - I can see it was a static date:

this timestamp(now(), 'YYYY-MM-DD HH:MM:SS.fff') should update it everytime with the right format

Not applicable
Author

thank you so much it is working!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

yoel

Not applicable
Author

Your welcome