Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ferha_jafri
Partner - Creator III
Partner - Creator III

How to convert text values which are in the database to numeric values

Hello Everyone,

The issue i am facing is there are two fields as year and month in the database which are saved in the database in text format although in qlikview it is showing as numeric but numeric functions are not working on these fields as max, it is very urgent.

Thanks in advance

Ferha Jafri

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You can use the num# function to create numbers from text. If you want to convert strings to dates you can use the date# function. For timestamps (aka datetime) there's the timestamp# function. All these functions accept a format string as second parameter to specify how the string should be parsed.

num#('234.46', '##0.00')

date#('2013 Jan 25', 'YYYY MMM DD')

timestamp#('20131011 11:12:45.321 AM', 'YYYYMMDD hh:mm:ss.fff TT')

See the help file for more details.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

You can use the num# function to create numbers from text. If you want to convert strings to dates you can use the date# function. For timestamps (aka datetime) there's the timestamp# function. All these functions accept a format string as second parameter to specify how the string should be parsed.

num#('234.46', '##0.00')

date#('2013 Jan 25', 'YYYY MMM DD')

timestamp#('20131011 11:12:45.321 AM', 'YYYYMMDD hh:mm:ss.fff TT')

See the help file for more details.


talk is cheap, supply exceeds demand
ferha_jafri
Partner - Creator III
Partner - Creator III
Author

Thank you so much