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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
cliff_clayman
Creator II
Creator II

How do I refer to LongMonthNames variable in script

I would like to use the variable LongMonthNames in my script, but I cannot figure out what the syntax should be.

Month(OrderDate) AS Month,

This is what I currently have.  What do I need to change the variable to so I can utilize the Long Month Names variable that is created in the Main script?

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';

1 Solution

Accepted Solutions
maxgro
MVP
MVP

try

Dual(      date(OrderDate, 'MMMM'),     Month(OrderDate))                     AS Month

View solution in original post

9 Replies
Frank_Hartmann
Master II
Master II

try using only this

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

hope this helps

cliff_clayman
Creator II
Creator II
Author

No, I do not want to do that.  I want to use the LongMonthNames variable.

Frank_Hartmann
Master II
Master II

then use this:

=Date(Month,'MMMM')

hope this helps

cliff_clayman
Creator II
Creator II
Author

What is the point of QlikView adding the LongMonthNames variable if I can't use it?

Frank_Hartmann
Master II
Master II

Date(Month,'MMMM') will call the longmonthname according your script!

cliff_clayman
Creator II
Creator II
Author

You do not reference the field name in that code...

Frank_Hartmann
Master II
Master II

But by transforming into 'MMMM' Qlikview calls the Variable LongMonthNames in Script!

cliff_clayman
Creator II
Creator II
Author

Okay, I used the following code:

Date(OrderDate,'MMMM') AS Month

I am getting multiple values for the months whereas I am only expecting one value for each month name.  When I use the original code,

Month(OrderDate) AS Month

I only get each individual month name.

Also, is the function called MonthsName used for long month names?  It appears to require 2 parameters.

maxgro
MVP
MVP

try

Dual(      date(OrderDate, 'MMMM'),     Month(OrderDate))                     AS Month