Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Force import of column as number in script

Good afternoon all,

I would like some help modifying the script to force a column to import as numbers to make it easier to work with in an expression in the QV doc.

Is there a way to do that? or do I need to do this in the QV doc somehow?

Thanks,

Steve

6 Replies
Gysbert_Wassenaar

You can use the num# function to create a number from a string.

num#(MyField) as MyNumber

There are three optional arguments for format string, decimal separator and thousands separator. See the help file for more information.


talk is cheap, supply exceeds demand
vivek_niti
Partner - Creator
Partner - Creator

Hi,

You can use Autonumber() or RowNo() in the script.

Regards,

Vivek

Not applicable
Author

How do I do that?

Steve

QlikCommunity<http://community.qlik.com/index.jspa>

Re: Force import of column as number in script

created by Vivek Niti<http://community.qlik.com/people/vivek.niti> in New to QlikView - View the full discussion<http://community.qlik.com/message/340455#340455>

vivek_niti
Partner - Creator
Partner - Creator

Hi, u can use the functions as

LOAD *,

      autonumber(KEY1) AS Auto_num

From....

OR

LOAD *,

      RowNo() AS RowCount

FROM.....

Autonumber() - it assigns a unique value to the string.

RowNo() - it inputs the row number for the records..

regards

Not applicable
Author

Mayby I am missunderstanding or maybe I have not been clear...The column I an trying to load is from a spreadsheet where the clumn is currently loaded as text. I need to load the values as numbers rather than text so my expressions will work in the QV doc.

I do not want to replace the values with sequential numbers which is what these options seem to do.

Thanks though.

Steve

Not applicable
Author

I have tried this but I still have entries that QV is not seeing as numbers so I may still be doing something wrong.

Just to confirm, this is a process i can use in the script correct? And it would convert text values in the column to numbers?

Thanks!

Steve