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

Converting a variable name to Month number

I have a variable (vMonthNum) that I access through an input box. I have a constraint on it to show listed values referencing a Month field (Jan, Feb, Mar, etc)

I want to convert the selection the user makes (Jan, Feb, Mar, etc) to a number that corresponds to the month. So if from the drop down the user selects Mar I need it converted to 3. Looking for the expression to do this.

Thanks in advance,

Steve

1 Solution

Accepted Solutions
sunny_talwar

Try this:

vVar2 = Num(Date#(vVar1, 'MMM'))


vVar2 = Num(Month(Date#(vVar1, 'MMM')))

where vVar1 is linked to your inputbox

HTH

Best,

Sunny

View solution in original post

4 Replies
sunny_talwar

Try this:

vVar2 = Num(Date#(vVar1, 'MMM'))


vVar2 = Num(Month(Date#(vVar1, 'MMM')))

where vVar1 is linked to your inputbox

HTH

Best,

Sunny

sunny_talwar

Attaching a sample:

zagzebski
Creator
Creator
Author

Thank so much!

sunny_talwar

No problem

I am glad I was able to help.

Best,

Sunny