Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ramya_grandhi
New Contributor

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..

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

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

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

2 Replies
MVP
MVP

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

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
New Contributor

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

Thank You Sunny,