Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

Not applicable

Load Issue - Like Numbers Combining Records

I have a model where I am loading information from a table.

The customer_number field is a nchar(10) and the customer_name field is a nchar(36)

I have 2 customers in the table

Customer NumberCustomer Name
0090060    USGS - National Wildlife Health Cent
090060   Village of Wellington             

I am loading only these 2 columns in this table to try and see what the issue is.

So my load looks like the following

Dim_Customers:
LOAD

"Customer number" as [Dim_Customers_CustomerNumber],
"Customer name";
    
SQL SELECT //"Dim_Customers_dKey",
LTRIM(RTRIM(CAST("Customer number" as Varchar(10)))) as "Customer number",
"Customer name"
FROM [Dim_Customers];

When I run the load I am getting one customer number of 090060 for both customer names.  Why?  Help?

I am currently running QlikView 11.20.12235.0 SR5 64-bit.

Thank you for your help in advance.

Sincerely,

CRusso

1 Solution

Accepted Solutions
chematos
Valued Contributor II

Re: Load Issue - Like Numbers Combining Records

Try this:


Dim_Customers:
LOAD distinct

text("Customer number") as [Dim_Customers_CustomerNumber],
"Customer name";

     SQL SELECT //"Dim_Customers_dKey",
LTRIM(RTRIM(CAST("Customer number" as Varchar(10)))) as "Customer number",
"Customer name"
FROM [Dim_Customers];

3 Replies
chematos
Valued Contributor II

Re: Load Issue - Like Numbers Combining Records

Try this:


Dim_Customers:
LOAD distinct

text("Customer number") as [Dim_Customers_CustomerNumber],
"Customer name";

     SQL SELECT //"Dim_Customers_dKey",
LTRIM(RTRIM(CAST("Customer number" as Varchar(10)))) as "Customer number",
"Customer name"
FROM [Dim_Customers];

Not applicable

Re: Load Issue - Like Numbers Combining Records

Worked like a charm.  Thank you so much!!!

chematos
Valued Contributor II

Re: Load Issue - Like Numbers Combining Records

I you don't format to text, it will be formatted to the same number format and you will have the same customer number, meanwhile the text format will keep the zeros.

Regards

Community Browser