Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 Number | Customer 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
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];
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];
Worked like a charm. Thank you so much!!!
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