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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
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
MVP
MVP

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
Partner - Champion III
Partner - Champion III

Hi,

Try like this

LOAD

*,

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

FROM DataSource;

Hope this helps you.

Regards,

jagan.

Colin-Albert
Partner - Champion
Partner - Champion

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.