Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I do hope someone can help me with importing dates to Qlikview. I am using a Firebird db as source and importing budget data per store, per day into QV. The data seems to exist, but not displayed correctly.
As is showed in the screenshot, I can actually click and select a date and QV recognises it, but the I cannot see any dates
I tried unsuccessfully to format the date with Date( ), Date#( ), Day( ) etc, no luck.
Any help please?
Are you sure you used date#() correctly?
It needs the format the date from the Firebird db is in to create a QV date.
Have you tried exporting the data as a flat-file first?
hi, are you sure if that is not a problem with the odbc driver? i'm saying this because some reasons:
my suggestions:
my experience with AS/400
rgds and good luck
Hector/Mark, thanks for the replies.
I used a sample flat file from the tutorials to test date imports - this works fine and I get Julian and mm/dd/yyyy dates in, and can format it.
Also exported the table to csv files from the original app - the date format in this file is dd/mm/yyyy. I could not see any manupulation actions to get the data to CSV, so I assume this is the format, and then the code looks like this:
SQL SELECT "NB_STORE_ID",
//"NB_DATE",
Date#("NB_DATE" , 'dd/mm/yyyy' ) as "budate",
"NB_VALUE",
"NB_TARGET"
FROM "NK_BUDGETS";
The commented part gives the results shown in my screenshot, the next line is my attempt at manipulating it - this gives an error though. Not changing the name does not help either.
Date#() is a QlikView function, so needs to be done outside of the SQL (which is just being passed to your DBMS, which has no idea what to do with it). In other words:
LOAD *
,date#(NB_DATE,'DD/MM/YYYY') as budate
;
SQL SELECT
"NB_STORE_ID"
,"NB_DATE"
,"NB_VALUE"
,"NB_TARGET"
FROM "NK_BUDGETS"
;
DROP FIELD NB_DATE
;
I don't guarantee that's the actual script you'll need, but it at least has the date#() in the right place.
Thanks John, at least I do not get errors anymore.Your code gives me the original result, so I will now try different date formats. Is there a way to specify Julian dates as the source for QV? (numeric dates e.g. 34566)
Oh, the dates show the same "squares" in the import wizard as well - when you preview the table in "Create Select statement" dialog. '
Driver issue then?
QlikView doesn't have formatting codes for Julian dates, but you can still work it out with a more complicated expression. However, different people mean different things by Julian dates. What date is 34566? How is it read?
I understand it to be a numeric representation of the date, x days from 1 Jan 1900 (I think). The same format as in the help file, when you search for date, the date
1997-08-06 is represented by 35648.
Does that help?
OK, if you have dates somewhere that are already in the QlikView numeric format, you don't need date#() at all. You just need to tell QlikView to interpret that number as a date, which should be date(YourInputDate) as YourDate.