Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
BartVA
Contributor III
Contributor III

Propagation of date type through SQL - QVD pipeline?

I have an SQL database with a "date" field of type date.

BartVA_0-1708620012066.png

(screenshot from pgAdmin)

I create a QVD like this:

SET DateFormat='D/MM/YYYY';

$(vTableName):
Load *;
SELECT *
FROM $(vTableName) WHERE "date" >= '$(vCompanySplitDate)';

Store $(vTableName) into '$(vQVDFile)';

In another Qlik app, I then load this QVD like this:

SET DateFormat='DD-MM-YYYY';
 
Raw:
Load 
id, 
date
From [...]
(qvd);
 
An export of Raw in csv shows date in the format 2023-07-28.
The model viewer shows this:
BartVA_1-1708620740004.png

 

My question is, what are the data types of "date" after the first step (in the QVD) and after the second step (in the "Raw" table). Date? Integer? String?

And if they're not date, how can I avoid that they loose their date type, and/or best way to convert them back to date type?
Labels (2)
1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

The statement

SET DateFormat='D/MM/YYYY'

If valid till your data is in the App (Dashboard).

If you want the same format to follow in QVD, you will have to define it in Load Statement.

Load *, Date(DateField,'DD/MM/YYYY');

If you don't define it, it will use same format as you have in source.

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

The statement

SET DateFormat='D/MM/YYYY'

If valid till your data is in the App (Dashboard).

If you want the same format to follow in QVD, you will have to define it in Load Statement.

Load *, Date(DateField,'DD/MM/YYYY');

If you don't define it, it will use same format as you have in source.

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
BartVA
Contributor III
Contributor III
Author

Great, thanks!