Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
obalikawa
Contributor
Contributor

Multiple date formats

Just wondering if there is any script that will help me distinguish European date format ddmmyyyy from US date format mmddyyyy? I have an excel document with a date column that contains the two formats(the column itself is formatted as general). Instead of changing excel, is there qlikview script that would allow me to create a new field containing a single format? Thanks.

Labels (1)
1 Reply
rubenmarin

Hi, qlik uses one general date format, define in the initial variables of the script (DateFormat)

But if an excel has the same column with value (as an example) 01022022 wich in some cases it means one of february and in others 2 of january, this can't be automatically solved.

If the excel has column where it says something related to format date you can use the Date#() function to specify the format od the date that is being readed, in emaple:

If(Country='US'
  ,Date(Date#(ExcelDateField,'MMDDYYYY'))
  ,Date(Date#(ExcelDateField,'DDMMYYYY'))
) as Date