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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Converting a date to text

Do anybody know if there is an expresion that will convert a date to text? For instance Jan-2013 to Jan?

4 Replies
Not applicable
Author

Hi,

if your field value is 'Jan-2013' you can use the Left() function.

Left(Field,3)

Hope it helps

Regards

Giampiero

Not applicable
Author

suppose your date field from where you get Month Year as Jan-13 is Date then create a field MonthNumber in ur script;

num(Month(Date)) as MonthNumber

Now u can create an inline table in ur script:

Load * Inline

[

MonthNumber,MonthName

1,Jan

2,Feb

3,Mar

4,Apr

5,May

.

.

.

.

12,Dec

];

jagan
Partner - Champion III
Partner - Champion III

Hi,

Left('Jan-2013', 3) is the best option to get the month name.

Regards,

Jagan.

hic
Former Employee
Former Employee

Using Left() will work, but you will not be able to sort the months properly. Use the following instead:

Month(Date#(DateField,'MMM-YYYY'))

HIC