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

Months full names to short Names

Hi Friends,

i'm having the Month_FullName as a field. How can i get short names from this filed.

for e.g; January, February, March...........   to Jan , Feb, Mar, Apr.......

Please suggest how to do it.

Regards

Krishna

22 Replies
krishna20
Specialist II
Specialist II
Author

Hi ,

Please find the below attachment and guide me to find another ways to resolve this.

Regards

Krishna

ashfaq_haseeb
Champion III
Champion III

Hi Krishna,

Check this

Regards

ASHFAQ

MarcoWedel

Hi,

the reason for the behaviour you experienced is that you already loaded your month_fullnames as a date field formatted as month fullnames. So the proposed solutions using the Date# function didn't find a string to interpret as a date (that's what the #-functions do).

On the other hand this means, that your front end expression

=Month(Date(Month_FullNames,'MMM'))

can be abbreviated to

=Month(Month_FullNames)

as the formatting date() function is useless in this case, it does not change the underlying numerical value of your Month_FullNames field (Ret_Month).


Using this expression

Date(Date#(SubField('$(MonthNames)',';',MONTH),'MMM'),'MMMM') as Ret_Month

to create your Ret_Month field in the script leads to somewhat weird underlying numerical values:

QlikCommunity_Thread_139592_Pic1.JPG.jpg

because you are trying to create a complete date value from only a month field (the year information is missing) and then just formatting it to show month fullnames.

I therefore stick to my proposed solution

Dual(Date(Date#(MONTH,'MM'),'MMMM'), MONTH) as Ret_Month

which creates these underlying values:

QlikCommunity_Thread_139592_Pic2.JPG.jpg

like one would expect from a real month field.

If you wanted to create the month shortname field in the script, then one solution could be:

Month(Date#(MONTH,'MM')) as Ret_Month_short

hope this helps

regards

Marco