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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ramya_grandhi
Contributor III
Contributor III

How to Convert String Data type to Number Data Type in Qlik Sense

Hello Everyone,

I am a beginner of Qlik Sense. I have a MonthName Field with values like Jan, Feb, Mar, .....Dec. According to the business requirement, I want the maximum Month from the MonthName field. As Max() can't be applied on the String Field I don't have any idea on how to extract the maximum Month from this field. Can anyone help me on this.

Thanks in Advance..

1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

In the script, convert the string to a dual month field like this

Month(Date#(MonthName, 'MMM')) as MonthName

Now you can use

Max(MonthName) to get a number

or

MaxString(MonthName) to get a text for the max month

View solution in original post

2 Replies
sunny_talwar
MVP
MVP

In the script, convert the string to a dual month field like this

Month(Date#(MonthName, 'MMM')) as MonthName

Now you can use

Max(MonthName) to get a number

or

MaxString(MonthName) to get a text for the max month

ramya_grandhi
Contributor III
Contributor III
Author

Thank You Sunny,