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

Month

I have month in text format , How do i convert it into a propaer month format ?

1 Solution

Accepted Solutions
sunny_talwar

Do you have January or Jan?

For January, you can try this:

Num(Month(Date#(Month, 'MMMM'))) as MonthNum

For Jan, you can try this

Num(Month(Date#(Month, 'MMM'))) as MonthNum

View solution in original post

5 Replies
sunny_talwar

Do you have January or Jan?

For January, you can try this:

Num(Month(Date#(Month, 'MMMM'))) as MonthNum

For Jan, you can try this

Num(Month(Date#(Month, 'MMM'))) as MonthNum

jpenuliar
Partner - Specialist III
Partner - Specialist III

sunny_talwar

Also make sure that you have the following environmental variables:

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

Mark_Little
Luminary
Luminary

Hi,

Depends how exactly is it stored and how do you want to show it.

One answer would be a nested if, but the maybe a simpler answer if you could supply a little more details.

Mark

Chanty4u
MVP
MVP

try below

if month is Jan,Feb,Mar .....

andfiled is Month

then write

Num(Month)  in list

or use in script as

Num(Month) as Monthnum

or else use

inline wizard like below

load * inline

Month,MonthNum

Jan,1

Feb,2

Mar,3

apr,4

;

;

;

];

or

using if(Month='Jan',1,if(Month='Feb',2,if(Month='Mar,3.........))))))))))))