Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Tags (1)
3 Replies
Not applicable

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

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

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

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

bestofwest
Contributor II

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

Create a JS function on Edit Module.

Community Browser