Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
marleygt
Creator
Creator

Date Conversion in Loading Script

Hi all.

I've a problem with a data format.

What I need: to change format in loading script.

Actual format: numeric, i.e.:('42079')

Need to change in: 'DD/MM/YYYY;

In the beginning of loading script I've already set this: SET DateFormat='DD/MM/YYYY'; but is not working on that specific field.

I tryed to use lastly (cause I made some testing before posting):

Date#(DATDOC,'DD/MM/YYYY') as Data,   (DATDOC is field name from original loading file)

Is not giving an error whilst loading, but date still remain in same numeric format '42xxx'

I found a lot of discussion concerning date format, but no one si fitting good for my case.

I see that if I use for instance, in a listbox properties, in number properties, "Override document settings" ad date with the needed format, is working perfectly. But I need to convert this in the loading and not locally in any listbox or instance I will create.

Any suggestion for performing that?

Thank you in advance.

Alex

1 Solution

Accepted Solutions
puttemans
Specialist
Specialist

Try Date, without the #

View solution in original post

7 Replies
puttemans
Specialist
Specialist

Try Date, without the #

View solution in original post

jonathandienst
Partner
Partner

Qlikview dates are actually numeric values so there is no need to convert it. All that is missing is the formatting, so this should be sufficient:

     Date(DATDOC) As Date,

Then it will be stored with the default date format and there is no need to override any doc settings.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable

there is just one character to much

write

Date(DATDOC,'DD/MM/YYYY') as Data

Data# Needs if a dateformat is different as Qlikview expects

in your case the number is a valid date Format and you Need to tell Qlivkiew to Show as your format

robert_mika
Master III
Master III

Date(DATDOC,'DD/MM/YYYY') as Data


2015-08-04_104000.png

rubenmarin

Hi Alex, Date#() is used to tell QV wich date format has the field wich is loading.

Date() (without #) is used to give format in QV.

So try using Date(Date#(DATDOC,'DD/MM/YYYY')) as Data

Btw, a date is a number internally, the format of the date is just the way to represent that number.

marleygt
Creator
Creator
Author

Damn....was more easier then expected....

Thank you guys! Is working perfeclty...

Argh...I can't sign 3 right answer...I am going to flag the first one, cause it was the fastest right answer, but thank you all!

marleygt
Creator
Creator
Author

Thank you Ruben for clarifying!