Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
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

View solution in original post

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