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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

Date text Change

Hello,

I need to change monday 15th february 2016 to this 15-02-16.

Pls help!

Thanks!

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

Hi,

Try this

Date(Date#(replace(SubField('$(Fecha Inicio)',', ',-1),' de ',' '),'DD MMMM YYYY'),'DD_MM_YYYY') as [Fecha Inicio],
Date(Date#(replace(SubField('$(Fecha Termino)',', ',-1),' de ',' '),'DD MMMM YYYY'),'DD_MM_YYYY') as [Fecha Termino]

Read Excel and sort the data

Edit:

Environment variables should be in your format..

SET DateFormat='DD-MM-YYYY';
SET TimestampFormat='DD-MM-YYYY h:mm:ss[.fff]';
SET MonthNames='ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic';

SET DayNames='lun;mar;mié;jue;vie;sáb;dom';

View solution in original post

17 Replies
agustinbobba
Partner - Creator
Partner - Creator

Hi Pablo!

Try this!..



DATE(MakeDate(YEAR(Date), MONTH(Date), DAY(MDate)),'DD-MM-YY')   AS  Date

Best regards!

Agustin.

MK_QSL
MVP
MVP

Is it monday 15th february 2016 or 15th february 2016?

I mean WeekDayName is there or not?

pgalvezt
Specialist
Specialist
Author

Hi,

I  put a sample  for better understanding.

Thanks!

Not applicable

=

Date (

  MakeDate (

  Year (Date (Date# (Mid ('monday 15th february 2016', Index ('monday 15th february 2016', ' ', 2) + 1), 'MMMM YYYY'))),

  Month (Date (Date# (Mid ('monday 15th february 2016', Index ('monday 15th february 2016', ' ', 2) + 1), 'MMMM YYYY'))),

  KeepChar (SubField ('monday 15th february 2016', ' ', 2), '0123456789')

   ),

  'DD-MM-YY')

MK_QSL
MVP
MVP

Sorry but Can you post 2-3 lines only in English... I don't understand this language... Sorry For this..!

jonathandienst
Partner - Champion III
Partner - Champion III

If dateField contains a date like: monday 15th february 2016

=Date(Date#(TextBetween(dateField, ' ', 'th') & '-' & SubField(dateField, ' ', 3) & '-' & SubField(dateField, ' ', 4), 'dd-MMMM-yyyy'))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
agustinbobba
Partner - Creator
Partner - Creator

Pablo,

La fecha viene en ese formato desde la fuente?, creo que la solución de Ed Hilsinger es correcta, vas a tener que crear la fecha desde cero. A no ser que sea en formato numero que mi solución también es correcta.

Saludos,

Agustin

(The date source came in this format?, the solution of Ed hilsinger is correct, you need to make the date from scratch. but if the date format is as a number you can use my solution as well)

Not applicable

Hello

Please check if the attached prototype is ok for you.

psankepalli
Partner - Creator III
Partner - Creator III

Hi,

Please find the attached QVW, which converts the date to your required format.

First I created variable

vDate =Date#(TextBetween(InputDate, ' ', 'th') & '-' & SubField(InputDate, ' ', 3) & '-' & SubField(InputDate, ' ', 4), 'dd-MMMM-yyyy')

then re-used that variable into text box

=Date(vDate,'DD-MM-YYYY')

hope this will solve your problem

Thanks

PR