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

converting month number into month name

Dear Community.

i need to convert month number into monthname.

i have two table one table contain MonthName like Jan,Feb.........etc.

another table contain MonthNumbers like 01,02,03...........12 etc.

i want to convert monthnumbers into monthnames and so that i can link these two tables.

i tried using inline it's not working properly.

somebody help me please.

Thanks,

Mukram.

5 Replies
MayilVahanan

HI

Did u get month field from datefield?

if so,

Load *,

if(num(Month(DateField)) <10, '0'&num(Month(DateField)),num(Month(DateField)) ) as MonthNumbers from table1;

Else,

inline table only can use.QV is case sentitive , so please check once the values and fieldname

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Dear

in  one table i'm getting the Month from TransactionDate (06/12/2012)

Month(TransactionDate ) as Month,

in another table i have MonthYear(201206) from that i have taken monthNumber.

i applied your if condition but i'm gettings month numbers doubles.

1,2,,,12 and again 1,2,3,4,,,,,,,,12 etc.

thanks,

Mukram.

Not applicable
Author

Hi Mukram,

Use mapping load to create Monthname and monthnumm like,

Monthtable:

Mapping load inline [

Monthnum, MonthName

01,jan

02,feb

03,Mar

..]

After that use applymap function where you want monthname.

applymap('monthtable',right(MonthYear,02) as Monthname.

Hope this helps..

Regards,

chandra

sivarajs
Specialist II
Specialist II

Use this

Date(Date#('MonthNumbers','MM'),'MMM') as Monthname

Not applicable
Author

Hi, I had the same problem and in the end I created a variable called "vThisMonthName" using this nested if statement

 

=

if((vCuFiscalPeriod)=1,'Jan',

if((

vCuFiscalPeriod)=2,'Feb',

if((

vCuFiscalPeriod)=3,'Mar',

if((

vCuFiscalPeriod)=4,'Apr',

if((

vCuFiscalPeriod)=5,'May',

if((

vCuFiscalPeriod)=6,'Jun',

if((

vCuFiscalPeriod)=7,'Jul',

if((

vCuFiscalPeriod)=8,'Aug',

if((

vCuFiscalPeriod)=9,'Sep',

if((

vCuFiscalPeriod)=10,'Oct',

if((

vCuFiscalPeriod)=11,'Nov','Dec')))))))))))