Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Eureka99
Contributor II
Contributor II

Load by length

Hi,

 

I'm trying to load some data that has main account numbers and user accounts. The main accounts are 6 digits long and the users are 10 digits.

 

I've tried using the LEN function as shown below but I keep getting the following error. Can someone help me with the easiest way to do this?

 

ODBC CONNECT32 TO Qlik (XUserId is bAFVVTJMSbbOWSJOTDcCTCA, XPassword is QfeZSWdNODZCWcNGSG);
SQL SELECT MPE0PA as Cust,
Len(MPE0PA) as LenCust,
    MPITNO as ItemNO,
    MPPOPN as Alias
FROM EIT.MVXCDTA.MITPOP00;

 

 

 

Eureka99_0-1598021506061.png

 

Labels (3)
1 Solution

Accepted Solutions
Kushal_Chawda

LEN function is native to Qlik and supported in few database like Sql server. Looks like your source database does not support that function. In this case, either you can use preceding load or use source native function 

With preceding load you can use Qlik's native function like below

ODBC CONNECT32 TO Qlik (XUserId is bAFVVTJMSbbOWSJOTDcCTCA, XPassword is QfeZSWdNODZCWcNGSG);

LOAD Cust,
Len(MPE0PA) as LenCust,
   ItemNO,
   Alias ;
SQL SELECT MPE0PA as Cust,
    MPE0PA,
    MPITNO as ItemNO,
    MPPOPN as Alias
FROM EIT.MVXCDTA.MITPOP00;

 

or check which function is supported by the source to get the lenght of string. Give it a try as below

 

SQL SELECT MPE0PA as Cust,
length(MPE0PA) as LenCust,
    MPITNO as ItemNO,
    MPPOPN as Alias
FROM EIT.MVXCDTA.MITPOP00;

 

View solution in original post

1 Reply
Kushal_Chawda

LEN function is native to Qlik and supported in few database like Sql server. Looks like your source database does not support that function. In this case, either you can use preceding load or use source native function 

With preceding load you can use Qlik's native function like below

ODBC CONNECT32 TO Qlik (XUserId is bAFVVTJMSbbOWSJOTDcCTCA, XPassword is QfeZSWdNODZCWcNGSG);

LOAD Cust,
Len(MPE0PA) as LenCust,
   ItemNO,
   Alias ;
SQL SELECT MPE0PA as Cust,
    MPE0PA,
    MPITNO as ItemNO,
    MPPOPN as Alias
FROM EIT.MVXCDTA.MITPOP00;

 

or check which function is supported by the source to get the lenght of string. Give it a try as below

 

SQL SELECT MPE0PA as Cust,
length(MPE0PA) as LenCust,
    MPITNO as ItemNO,
    MPPOPN as Alias
FROM EIT.MVXCDTA.MITPOP00;