Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Load data from database using concatination

Hi all;

i work with database Sqlserver in our server  , i succeded to have connction between Qlikview and Data base,

I selected the values that i want to load  like :

OLEDB CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=False; ..........;

SQL SELECT

code1,code2

from ......

i want to concatinate these two code  like :

SET Verbatim = 1;

LOAD Distinct Text(code1&code2) as Concat   

FROM    database.table


how do i do for loading this COncat please


thanks all;

12 Replies
swuehl
Not applicable

Re: Load data from database using concatination

Not sure if I understand what you are finally trying to achieve, maybe something like this using a SQL query and a preceding LOAD:

OLEDB CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=False; ..........;

SET Verbatim = 1;


LOAD Distinct Text(code1&code2) as Concat; 

SQL SELECT

code1,code2

FROM    database.table;

kush141087
Not applicable

Re: Load data from database using concatination

try this

Load *,

code1&'-'&code2 as Concat;

SQL SELECT

code1,code2

from  Table;

Not applicable

Re: Load data from database using concatination

hi ,i used this script

SET Verbatim = 1;

LOAD Distinct Text(code1&code2) as Concat

FROM    excel file to load a distinc concatinat values

but now i work with database sqlserver but not an excel file

i want to use a load function with this database ,its possible? if no how do i do for getting the concatinate distinc values

thanks

Not applicable

Re: Load data from database using concatination

hi colegue

i tried it but it seem an error message  that say: it didn't know code1 and code2

other proposition

thanks

Not applicable

Re: Load data from database using concatination

an error message code1 not found field

balrajahlawat
Not applicable

Re: Load data from database using concatination

Does Code1 & Code2 field exist in your database table from which you are fetching these fields??

If yes, may be case sensitivity issue?

Not applicable

Re: Load data from database using concatination

good morning Balraj

yes , it does , they exit in my database , when i use only with SQL select , , i dont have any probléme or error

like :

OLEDB CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=False;User ID=.....;Initial ........

SQL SELECT

    code1,

    code2

from data base.table;

i dont any probléme here, but when i use this script:

OLEDB CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=False;User ID=.....;Initial ........

Load *,

code1&'-'&code2 as Concat;

SQL SELECT

code1,code2

from  Table;

i have an error message that these field not found or indifined field

Not applicable

Re: Load data from database using concatination

resolved

mayilvahanan
Not applicable

Re: Load data from database using concatination

Hi

Can you able to share the screenshot for your script and error message.