Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Specialist II
Specialist II

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];

View solution in original post

3 Replies
chematos
Specialist II
Specialist II

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
Author

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

chematos
Specialist II
Specialist II

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