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

Need Help in Script Where condition

Hi,

I would like to load only list of numbers from the database, so I am manually writing every day like as

Load

AAA,

BBB,

CCC;

Sql Select

AAA,

BBB,

CCC

Where CCC IN('51',52');    

My question is I would like to give the CCC variable value numbers in excel file or in a text file.

Thanks in advance to advise ...

10 Replies
Anonymous
Not applicable
Author

You mean to say, you want to define those values of CCC in Excel and then use CCC in where condition, is it?

What issue you are facing with manual porcess?

PrashantSangle

Hi,

Use exist()

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
tresesco
MVP
MVP

Try it like:

List:

Load

          CCC

From <Excel>;

Tab:

Load

          AAA, BBB, CCC

From  <> Where exists (CCC);

Drop table List;

PrashantSangle

Hi,

For example

ExcelFile:

Load CCC from excel;

Table:

Load AAA,

     BBB,

     CCC

from tableName where exist(CCC,CCC)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Thanks for your reply,

When I copy from the CCC value in excel, I am getting the following error.

Token œ was not valid. Valid tokens: ( + - ? : DAY INF NAN RID ROW RRN CASE CAST CHAR DATE DAYS HASH.

Not applicable
Author

Let me try your example....

Thanks and Regards...

Not applicable
Author

Hi,

If I use exits, I am getting the error of SQL0104 - Token EXIST was not valid. Valid tokens: < > = <> <= !< !> != >= ¬< ¬> ¬= IN NOT.

Exist('96732','96733','96734','96735','96736','96737','96738')

tresesco
MVP
MVP

Exists() is a qlikview function; can't be executed in SQL. You should rather try directly the SQL statement (with IN ). Qlikview sends the sql statement to SQL engine in the dbms and it's get executed there. Hence, you can use the SQL statement as it is directly here in qv.

SQL Select AAA, BBB, CCC

         From <> Where CCC IN('51',52') ;  

Not applicable
Author

Hi Tresesco,

Thanks for your reply, I tried before In function only in the sql statement, the

When I copy from the CCC value in excel file and paste in the qv script, I am getting the following error, and when I manually key the numbers in the qv script its working fine, I don't know where I making mistake.

Error message:

Token œ was not valid. Valid tokens: ( + - ? : DAY INF NAN RID ROW RRN CASE CAST CHAR DATE DAYS HASH.

Thanks to proceed how do i proceed