Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

qlikrajan
Contributor III

adding prefix 0 while loading from SQL to Qlikview

Hi experts,

I am pulling this data from SQL into Qlikview using basic select * from abc statement. The issue is for CTCRSZ, I m getting '001' in both the rows in qlikview while in SQL one row has CTCRSZ '01' and another '001'.

       

CTACVLCTCREXCTCRSZCTCRTPCTCTDSCTCTVLCTCTWT
3036                                                 001CFPStandard Carton30362
99999DEF001CFPDEFAULT CARTON999990

Could you suggest how to fix the issue. Any help is much appreciated!

1 Solution

Accepted Solutions

Re: adding prefix 0 while loading from SQL to Qlikview

When you run the SQL query you don't see the same issue? May be bring it explicitly as text -> Text(CTCRSZ)

11 Replies

Re: adding prefix 0 while loading from SQL to Qlikview

When you run the SQL query you don't see the same issue? May be bring it explicitly as text -> Text(CTCRSZ)

qlikrajan
Contributor III

Re: adding prefix 0 while loading from SQL to Qlikview

Everything is pulled in text format.

Re: adding prefix 0 while loading from SQL to Qlikview

What if you try something like this in the SQL Query (not sure what the SQL syntax is, but try the idea)

LOAD Right(CTCRSZ, Len(CTCRSZ) - 1) as CTCRSZ;

SQL SELECT

     1 & Text(CTCRSZ) as CTCRSZ

FROM SOURCE

trdandamudi
Honored Contributor

Re: adding prefix 0 while loading from SQL to Qlikview

It is weird..... Try to bring in a Row Number and see what happens..

qlikrajan
Contributor III

Re: adding prefix 0 while loading from SQL to Qlikview

Actually when I was experimenting I put Text(CTCRSZ) in sql but that did not work. I try your code again.

qlikrajan
Contributor III

Re: adding prefix 0 while loading from SQL to Qlikview

nop...doesnt work

Re: adding prefix 0 while loading from SQL to Qlikview

Doesn't work? Error or the same issue of 001?

trdandamudi
Honored Contributor

Re: adding prefix 0 while loading from SQL to Qlikview

Did you run the SQL query by itself and checked the results ?

qlikrajan
Contributor III

Re: adding prefix 0 while loading from SQL to Qlikview

I was asking one of my friends to do that but I will check by myself

Community Browser