Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Setting/changing dateformat using script

Hi,

I have a question related to dateformat.

First of all, I have to clarify that I don't have a server solution, not does my Qlikview application have internet access.


I get my data from different spreedsheets, some with data from SAP.

My default dateformat is ; 'DD-MM-YYYY' - and I would prefer not to change this.

One of the files that I load to the script contains dates, but in the format 01.03.2013 (1st of march 2013).


How can I use the script so that the date gets showed as 01-03-2013 instead?

Thanks in advance

Martin

1 Solution

Accepted Solutions
maxgro
MVP
MVP

date(date#(excelfield, 'DD.MM.YYYY'), 'DD-MM-YYYY') as newfielddate

View solution in original post

5 Replies
avinashelite

Hi,

Try like this:

DATE(filed,'DD-MM-YYYY') as Newfeildname

or you can directly set in the script format

SET DateFormat='DD-MM-YYYY';

amit_saini
Master III
Master III

Martin,

Try this:

Date(Your_Date_Field , 'DD-MM-YYYY') as Date

Thanks,

AS

maxgro
MVP
MVP

date(date#(excelfield, 'DD.MM.YYYY'), 'DD-MM-YYYY') as newfielddate

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

LOAD

*,

Date(Date#(DateFieldName, 'DD.MM.YYYY')) AS FormattedDAte

FROM DataSource;

Hope this helps you.

Regards,

jagan.

Colin-Albert

First check that the date format in the SET block at the start of the script has the default date format as 'DD-MM-YYYY'

Then you can use

     date(date#(your_date_field, 'DD.MM.YYYY')) as date_field

The date formats must be uppercase.