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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Urgent help: unable to convert datetime from xls to date in qlikview

Dear all ,

I have the attached data in my xls file. I want to conver the date format to YYYY-MM-DD using the below function but not works.

=date#(date#(exceldatetimefiled, 'MM/DD/YYYY hh:mm'),'YYYY-MM-DD')

input:

datetime
30/1/2015 13:25
30/1/2015 11:47
30/1/2015 11:39
30/1/2015 9:48
30/1/2015 9:25

Output looking for is :

date:

2015-01-30

Kindly help me.

BR,

Chinna

3 Replies
Not applicable
Author

Hi Neeru K,

Make use of the makedate() function along with subfield.

your script should look something like:

date(makedate(subfield(datetime,'/',3),subfield(datetime,'/',2),subfield(datetime,'/',1)),'YYYY-MM-DD')

Not applicable
Author

Hi,

Many thanks for your answer.

following is works for my case as Qlikview is reading data as DD/MM/YY hh:mm format I had to use below.

date(Date#([Created Date],'DD/MM/YYYY hh:mm'),'YYYY-MM-DD') as %DateKey

BR,

Neeru

Anonymous
Not applicable
Author

Create a JS function on Edit Module.