Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
MVP
MVP

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;

Kushal_Chawda

try this

Load *,

code1&'-'&code2 as Concat;

SQL SELECT

code1,code2

from  Table;

Not applicable
Author

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
Author

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
Author

an error message code1 not found field

Anonymous
Not applicable
Author

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
Author

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
Author

resolved

MayilVahanan

Hi

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

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.