Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
subbareddykm
Creator II
Creator II

Number format

HI all i have below data,

I have ID and I want concatinate one fixed number with that ID and have some further caluculation.

My issue is after concatenation my new ID is still in string format and I want in Number format.

Sample:

LOAD ID,

  Num#(ID&56431256) as NewID

FROM

(ooxml, embedded labels, table is Sheet1);

Please share script as well , once it done

8 Replies
Anil_Babu_Samineni

May be this?

Num#(ID) & '56431256' as NewID

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
zhadrakas
Specialist II
Specialist II

try like

Num#(Num(ID, '0000000') & Num(56431256, '0000000'), '000000000000000')


it could be a problem if you have 14 or more digits

see here

https://gist.github.com/ralfbecher/6550467


techvarun
Specialist II
Specialist II

Num#(ID)*100000000 + 56431256 as NewID

neelima_g36
Contributor III
Contributor III

Hi,

May be try like this :

Sample:

Load *,

Num(NewID) as NewID_Num;

LOAD ID,

ID&'56431256' as NewID

FROM

(ooxml, embedded labels, table is Sheet1);

antoniotiman
Master III
Master III

Hi,

You can't because max nr of digits in QV is 14.

However

LOAD Num(ID&'1234') as NewID
FROM File;

So NewID is Numeric

Regards,

Antonio

balar025
Creator III
Creator III

QlikView works on AutoCasting. But Your assigning value is getting bigger. So, it is getting convert to text.

Not applicable

Hi Subbareddy,

Here is the script for this query

Common Id : 1234

Sample:

LOAD ID

FROM

[..\..\Downloads\Sample.xlsx]

(ooxml, embedded labels, table is Sheet1);

NoConcatenate

Sample1:

LOAD num(num(ID & 1234,'00000000000'),'00000000000')as NewId

Resident Sample;

DROP TABLE Sample

Not applicable

LOAD

ID,Num(Num(ID,'0000000')&Num(564312,'000000'),'000000000000')

FROM (ooxml, embedded labels, table is Sheet1);

It is working if the total digits are less than 14.