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

Announcements
Mastering Change Data Capture: Read Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

num month in name month

Hi all,

I have a problem. I have in my script a field Month which has number's months (1,2,3,4,5,6,...,12).

I don't have a date field and I want to convert the number's months in text (Jan, Feb, Mar,Apr, Jul,..., Dic).

How can I make it?

Please, it's important.

Thanks.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Month(MakeDate(0,MonthNum)) as Month

View solution in original post

6 Replies
PrashantSangle

Hi,

Use Inline table

try like

load * INLINE[

Month,MonthName

1,Jan

2,Feb

...

..

];

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
tresesco
MVP
MVP

Month(MakeDate(0,MonthNum)) as Month

MK_QSL
MVP
MVP

SubField('$(MonthNames)',';',MonthNumberField) as MonthNameField

prieper
Master II
Master II

Recommend to always convert partial dates into real dates and then to use QV's built-in logic and functions to handle in a formatted way.

So you may create a field with eg

MAKEDATE(1, MonthNum, Year)     AS Date

HTH Peter

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Try this

DateNum:

LOAD * Inline

[

DaNUM

1

2

3

4

5

6

7

8

9

10

11

12

];

FOR i =0 to  NoOfRows('DateNum') - 1

LET vMonthName =Peek('DaNUM',$(i),'DateNum');

Final:

    LOAD

     '$(vMonthName)'               AS Month_Num

    ,MonthName(MakeDate(Date(Year(TODAY()),'YYYY'),$(vMonthName))) AS MonthName

 

Resident DateNum;

NEXT i

DROP Table DateNum;

Not applicable
Author

Thanks a lot! It's what I wanted. In this way I have no problem to order the new field MonthName.