Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
NicholasIQ
Partner - Contributor
Partner - Contributor

Change data type from MySQL database

Hello all!

I am building an application for which I am loading the data directly from a MySQL database using SQL queries. Now my problem is the following: one field indicates the surface of a room and this field should be numerical. Apparently, this field's character type is varchar or string, as I cannot make any calculations with this field (I need a sum). How would I solve this? Changing the data type in the source is not an option, unfortunately.

My query is the following:

rooms:
SQL SELECT
id as room_id
sfc as surface_area
FROM table x

Thanks for your suggestions!

 

Labels (3)
3 Replies
jochem_zw
Partner Ambassador
Partner Ambassador

Have a look at the Num# function in the help, this will help you

Anil_Babu_Samineni

@NicholasIQ  Please share the rows how it is looks like in your database and after load into Qlik. 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
marcus_sommer

Such adjustment could be easily added within a preceding-load like:

rooms:
load *, num(num#(surface_area, 'FormatPattern')) as MyNumber;
SQL SELECT id as room_id, sfc as surface_area FROM table x