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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Number being Converted into Mixed Format.

Hi,

I have a field whose values(Numbers) are being represented as Text and number(some as number and some as Text). I want them to be represented as number as I have to compare with the same field in other table. I tried NUM and NUM# in the script, but as there are millions of records, the conversion is taking too long (around 2 hrs). So is there any faster way to do the conversion?

21 Replies
Anonymous
Not applicable
Author

Hi

Even though if I do what you have said, the numbers will still be text formatted right?!! which is an issue when comparing with the values with the same field name in other table, which is my requirement.

Not applicable
Author

Oh, Yes.

Maybe you need consider incremental load and convert to number based on time stamp if those records not change very frequently.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

When reading data from SAP, you may have to apply trim() to get rid of various leading and trailing whitespace. IMHO this isn't always done automatically like when reading from Excel or another file format.

You can do this even when reading QVD's that are created during a dedicated SAP export.

Anonymous
Not applicable
Author

Hi,

I did try to check the value of text(number) using text box and expression,

=num(Field)

which is giving me null value.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Num() returns NULL if Field doesn't contain a numerical value (text only). You should correct the text string before trying to format it using Num().

Peter

tamilarasu
Champion
Champion

Evaluate function will convert the text to integer. You can try the below script and check whether the format converted or not .

Load Evaluate(yourfield) as Num,

Num(Evaluate(yourfield) as FNum

From

Your qvd path.

Anonymous
Not applicable
Author

Hi,

It converted to integer, but the value is like this

Text                          Integer

12345908                    41439707

but I require

Text                          Integer

12345908                   12345908

tamilarasu
Champion
Champion

Could you attach some sample data. For me, it's working fine. See below.

Capture.PNG

jagan
Partner - Champion III
Partner - Champion III

HI,

Try like this

Alt(Num(FieldName), FieldName)

Regards,

Jagan.

NareshGuntur
Partner - Specialist
Partner - Specialist

Have you tried converting the field to number in Number tab under Document Properties?

Cheers,

Naresh