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

How to Display January as Jan

Hello,

I have a lot of data coming in with Months as January, February, March, etc...  In an effort to save a little space on my charts I would like to display these months as Jan, Feb, Mar, etc...

I have left the default Set values in place but I cannot seem to figure out how to use these.

Currently my data in loading from a QVD and looks like this:

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='$#,##0.00;($#,##0.00)';

SET TimeFormat='h:mm:ss TT';

SET DateFormat='M/D/YYYY';

SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';

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

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

Directory;

LOAD Segment,

     Month,

     Year,

     [Segment Monthly Cost],

     Fail,

     Pass,

     Remediated,

     [Complete by Target],

     [Complete by Original],

     [Projects not complete],

     [Budget of not complete],

     [BV of not complete],

     [Projects complete],

     [Budget of completed],

     [BV of completed],

     [Microsoft Patch %],

     [3rd Party Patch %],

     [AV Compliance],

     Total_Team_Member,

     Total_IT_Team_Member,

     Total_Contractor,

     Voluntary_Turnover,

     [# of Recordables],

     [# of Lost Days],

     [Total Lost Time]

FROM

ITDashboard_AllJoin.qvd

(qvd);

Can someone offer me some advice on how to convert these Months to display in three letters rather than the full name?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

Try below code in script:

Month(Date#(Month,'MM')) as Month_Short;

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi!

you can use left(Month, 3) to catch just first 3 letters or month(Month) that should use your variable setup for month name.

KR

Elena

Anonymous
Not applicable
Author

Hi,

Try below code in script:

Month(Date#(Month,'MM')) as Month_Short;

maxgro
MVP
MVP

add to the SET section of the script

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

then you can interpret the field Month and get a 3 char Month in your load

load

     .....

     .....

     Month(Date#(Month,'MMMM')) as ShortMonth,

     .....

Not applicable
Author

Thank you.  That worked perfect.

Not applicable
Author

That worked well if I put it inside of the dimension on that chart but couldn't get that to work in the script.

Thanks for the help.

Anonymous
Not applicable
Author

You're Welcome.

Regards

Neetha