Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Date format changing to numbers

Hello -

I have a data file that has a date field in the format MMM-DD-YYYY.

I have in my script some language to pull the parts of the date I want for my application:

Mid([Line item start date],4,3) AS adSRTmnth,
Mid([Line item start date],8,4) AS adSRTyear,

For whatever reason, the months and years appear as numbers as opposed to the words.

Any thoughts / suggestions?

Thank you.

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

If you´re using a date field, it´s better to use date functions

Month([Line item start date]) AS adSRTmnth,

Year([Line item start date]) AS adSRTyear,

View solution in original post

3 Replies
maximiliano_vel
Partner - Creator III
Partner - Creator III

Try

Month(Date#([Line item start date], 'MMM-DD-YYYY')) as adSRTmnth,

Year(Date#([Line item start date], 'MMM-DD-YYYY')) as adSRTyear,

Clever_Anjos
Employee
Employee

If you´re using a date field, it´s better to use date functions

Month([Line item start date]) AS adSRTmnth,

Year([Line item start date]) AS adSRTyear,

evansabres
Specialist
Specialist
Author

this works in the scripting, but does not produce any results. When I type in the 'MMM-DD-YYYY' the text remains black, am I doing something incorrectly?