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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
fred_s
Partner - Creator III
Partner - Creator III

Convert Datefield


I'm a newbie. Don't be too hard... [:)]

We have this weird kind of database, no sql, mysql or whatever.
This database supports ODBC, but only the basic stuff.
For most fields no problem, except Date fields.

Every Date comes in as a String (but documentprops says it's a date...).
Set Dateformat in script is correct ('YYYY-M-D').

"month (DateX) as Datex_month" doesn't do his job.

Question 1:
Is there a possibility, after (Re)loading the data, to convert this field (maybe to a new and real Date field?)?

Any ideas or Workarounds?

Question 2:
Most of the Qlikview examples split dates in to year, month and day.
Since I can't split these fields, is there a clever way to select Dates?
We can use * search for text and <=> for Numeric fields, but I have no idea how to select Dates.
So far no luck with > or between functions


Thanks in advance

Fred

11 Replies
johnw
Champion III
Champion III

Or create a separate calendar table after loading the main data. I also usually prefer my year and month be actual dates:

[Calendar]:
LOAD
Factdatum
,date(yearstart(Factdatum),'YYYY') as YearFactdatum
,date(monthstart(Factdatum),'MMM YYYY') as MonthFactdatum
;
LOAD fieldvalue('Factdatum',iterno()) as Factdatum
AUTOGENERATE 1
WHILE len(fieldvalue('Factdatum',iterno()))
;

fred_s
Partner - Creator III
Partner - Creator III
Author

Hi,

Thanks, especially Gabriel!

You All have been a great help.
It has been a pain for several weeks. Next time I won't wait that long.

Rob and John, thanks for the addition.

All problems solved (so far 😉

Fred