Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Sharbel
Contributor III
Contributor III

Converting text field to date

Hi,

I have column that contains "date" written in txt format (Date_inv)  , how can I convert it to date format ?

example:

smobariki_0-1674895708486.png

please fine attached sample file

Best regards,

Sharbel

 

 

 

Labels (1)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

Try this script.

 

//Important that your system variable LongMonthNames matches the spelling you have for your months in your excel document
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

[Sheet1]:
LOAD
[Date_Inv],
[Date],
dayname(Date#(trim([Date_Inv]),'DD-MMMM -YYYY')) as Date_intepret
FROM [lib://Downloads/smobariki.xlsx]
(ooxml, embedded labels, table is Sheet1);

It will give you an output like this.

Vegar_0-1674912596780.png

 

 

View solution in original post

2 Replies
Vegar
MVP
MVP

Try this script.

 

//Important that your system variable LongMonthNames matches the spelling you have for your months in your excel document
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

[Sheet1]:
LOAD
[Date_Inv],
[Date],
dayname(Date#(trim([Date_Inv]),'DD-MMMM -YYYY')) as Date_intepret
FROM [lib://Downloads/smobariki.xlsx]
(ooxml, embedded labels, table is Sheet1);

It will give you an output like this.

Vegar_0-1674912596780.png

 

 

Sharbel
Contributor III
Contributor III
Author

Works Perfect!

thanks Vegar