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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
prma7799
Master III
Master III

Date format for all

Hi All,

I have various date format  like INVC_DT =DD-MM-YYYY

                                                  HIRE_DT=MM/DD/YYYY

                                                  BL_BT_DT=MM.YYYY.DD

                                                  AND SO ON................

So I my user want only one date format like DD/MM/YYYY

is there any way to get above format for all

Thanks

Prashant

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

In script convert all dates to single format

LOAD

*,

Date(Date#(INVC_DT, 'DD-MM-YYYY'), 'DD/MM/YYYY') AS INVC_DT_FORMATTED,

Date(Date#(HIRE_DT, 'MM/DD/YYYY'), 'DD/MM/YYYY') AS HIRE_DT,_FOMATTED,

Date(Date#(BL_BT_DT, 'MM.YYYY.DD'), 'DD/MM/YYYY') AS BL_BT_DT_FORMATTED

FROM DataSource;

Hope this helps you.

Regards,

Jagan.

View solution in original post

6 Replies
deepakqlikview_123
Specialist
Specialist

Sample Script:

FinalTable:

Load

MyDateField

,DATE(ALT(Date#(MyDateField,’DD/MM/YYYY’)

,Date#(MyDateField,’MMM/DD/YYYY’)

,Date#(MyDateField,’DD/MMM/YYYY’)))           AS                MyFieldInDateFormat

Resident TablenAME;

jagan
Partner - Champion III
Partner - Champion III

Hi,

In script convert all dates to single format

LOAD

*,

Date(Date#(INVC_DT, 'DD-MM-YYYY'), 'DD/MM/YYYY') AS INVC_DT_FORMATTED,

Date(Date#(HIRE_DT, 'MM/DD/YYYY'), 'DD/MM/YYYY') AS HIRE_DT,_FOMATTED,

Date(Date#(BL_BT_DT, 'MM.YYYY.DD'), 'DD/MM/YYYY') AS BL_BT_DT_FORMATTED

FROM DataSource;

Hope this helps you.

Regards,

Jagan.

ashfaq_haseeb
Champion III
Champion III

Hi,

You need to look at alt function in case if it is through 1 field. For multiple fields you can convert then at script as suggested by Jagan.

Which conditional functions do you use?

Regards

ASHFAQ

prma7799
Master III
Master III
Author

Thanks Jagan... but I am unable to see Latest QlikView Discussions.

jagan
Partner - Champion III
Partner - Champion III

Hi,

I think there is some issue, you can use below link to see latest QV discussions.

Regards,

jagan.

jagan
Partner - Champion III
Partner - Champion III