Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
dmnab1
Contributor II
Contributor II

Same field 2 data types

Hi all,

 

I've got the following question, I have a table that has a field with numbers with the following formatting:
00001233 (data coming from Salesforce).

When I execute this

Lib Connect to 'Salesforce';

InvoicesTmp:
LOAD
    Id
Select
    Id
FROM Invoices;

 

I got this

Datatype1.png 

So two values: 00003945 and 00003960

 

However when I use that table in resident like below:

Invoice:
NOCONCATENATE
LOAD
	*
Resident
	InvoiceTmp;

Drop Table InvoiceTmp;

 

 Qlik recognizes some values as text and others as number

DataType2.png

 

What's the reason behind this? It's causing problems for me when linking tables, as the IDs can be in the format 00003414 or 3414. Both formats are valid, but they belong to different data sources.

 

Thanks!

Labels (2)
1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

It's hard for me to explain why this is happening - this is deep under the hood of Qlik, but I'd recommend using the function text() for your Id fields, to preserve the original format with the leading zeroes. This way, 00003414 and 3414 will remain separate:

LOAD

   text(id) as id
...
Cheers,

 

View solution in original post

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

It's hard for me to explain why this is happening - this is deep under the hood of Qlik, but I'd recommend using the function text() for your Id fields, to preserve the original format with the leading zeroes. This way, 00003414 and 3414 will remain separate:

LOAD

   text(id) as id
...
Cheers,

 

dmnab1
Contributor II
Contributor II
Author

Hi Oleg, thanks for your quick response.

Yes, that is what I'm gonna do.

Cheers