Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to write a Script to load SQL table into Qlikview table?

Hi There,

I need to load all the columns from SQL table into Qlikview table.

Tab1:

 

SQL

Select *
FROM db

WHERE (col1 IN $(a);

Is the above script is correct? I got an error msg,'Custom  read Failed'

Please help me

8 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this script

SQL

Select *
FROM db

WHERE col1 IN $(a);

What value is there in variable a?

Regards,

Jagan.

Not applicable
Author

Problem with the variable $(a)

rest is correct

Anonymous
Not applicable
Author

Let us consider the variable has ,

('1234','4567')

Anonymous
Not applicable
Author

Do we need to use load command or we can directly use SQL select to load the data into Qlikview table?

Tab1:

load *   SQL Select  *
FROM db

WHERE (col1 IN $(a));

Anonymous
Not applicable
Author

Got the below error,

Custome Read failed:

Tab1:

SQL Select *

FROM db

WHERE  (col1 IN ( '1234', '4567' ))

jagan
Partner - Champion III
Partner - Champion III

Hi,


Try this script

SQL

Select *
FROM db

WHERE col1 IN ($(a));

Regards,

Jagan.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Try this.

SQL

Select *
FROM db

WHERE col1 IN $(a);

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

May I ask you how you populate the variable "a" ?

what you need to do is, populate the variable with the full string including the '(" & ')'

let a = '('& chr(39) &'1234'& chr(39) &','& chr(39) & '5678'& chr(39) &')';

then do the select as

select * from DB  where col1 IN $(a)

I am using this method  with my QV app. So it will work

Thanks,

Aji Paul.