Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

akpofureenughwu
Contributor II

Date Format

I have a date field whose format is MM/DD/YYYY.

My prefered format is DD/MM/YYYY

How do I convert it to the prefered format

Regards

_________________________________________

[Inflow]:

LOAD

     [Date]as [Inflow_Date],

    [ASSET] as [Inflow_Asset],

    [CATEGORY] as [Inflow_Category],

    [YEAR]  as [Inflow_Year],

    [AMOUNT_k] as [Inflow_AMOUNT_k],

    [AMOUNT_j] as [Inflow_Amount_j]

FROM [lib://WIN-WIN/xxxxx.xlsx]

(ooxml, embedded labels, table is Inflow);

17 Replies
ahaahaaha
Honored Contributor

Re: Date Format

Hi,

try

Date(Date#(FieldDate, 'MM/DD/YYYY'), 'DD/MM/YYYY')

Regards,

Andrey

rahulpawarb
Valued Contributor II

Re: Date Format

Hello Akpofure,

Please refer below given sample expression:

//Date# function will interpret [Date] field in 'MM/DD/YYYY' format and

//Date function will convert it into 'DD/MM/YYYY' format

Date(Date#([Date], 'MM/DD/YYYY'), 'DD/MM/YYYY') AS [Inflow_Date]

Hope this will be helpful.

Regards!

Rahul

MVP
MVP

Re: Date Format

Read more on this topic here:

Get the Dates Right

Why don’t my dates work?

akpofureenughwu
Contributor II

Re: Date Format

Thanks you Rahul and Andrey... I actually did that.. but I'm getting a blank screen on my froint end.. See attached

MVP
MVP

Re: Date Format

Can you create Date without any manipulation and share a screenshot to show its format? I have a feeling that it might not be MM/DD/YYYY

akpofureenughwu
Contributor II

Re: Date Format

Here is the screenshot of the date without manipulation..

MM/DD/YYYY

MVP
MVP

Re: Date Format

I don't see any screenshot

akpofureenughwu
Contributor II

Re: Date Format

oops

Here it is

MVP
MVP

Re: Date Format

May be add Trim function to make sure that there are not extra spaces

Date(Date#(Trim(FieldDate), 'MM/DD/YYYY'), 'DD/MM/YYYY')

Community Browser