Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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
balrajahlawat
Esteemed Contributor

Re: Need Help in Script Where condition

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?

Re: Need Help in Script Where condition

Hi,

Use exist()

Regards

Regards,
Prashant Sangle
MVP
MVP

Re: Need Help in Script Where condition

Try it like:

List:

Load

          CCC

From <Excel>;

Tab:

Load

          AAA, BBB, CCC

From  <> Where exists (CCC);

Drop table List;

Re: Need Help in Script Where condition

Hi,

For example

ExcelFile:

Load CCC from excel;

Table:

Load AAA,

     BBB,

     CCC

from tableName where exist(CCC,CCC)

Regards

Regards,
Prashant Sangle
Not applicable

Re: Need Help in Script Where condition

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

Re: Need Help in Script Where condition

Let me try your example....

Thanks and Regards...

Not applicable

Re: Need Help in Script Where condition

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')

MVP
MVP

Re: Need Help in Script Where condition

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

Re: Need Help in Script Where condition

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

Community Browser