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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to write sql query/condition in edit script without using Database string?

How to write sql query in my edit script to run without using database link for importing data by using ODBC or OLEDB? I got data from excel and it needs some condition to run before loading all the data into qlikview.

Thanks.

4 Replies
fkeuroglian
Partner - Master
Partner - Master

Hi, write sql without connect to a database?

sql for what?

try to explain better what you want or put an example to be easier to help you

Fernando

Not applicable
Author

Hi Fernando,

Thanks for your response.

Actually I need to write a condition while loading data from Excel into Qlikview after my regular Load statement followed by my SQL condition on some of the functions like Select, group by, .....etc

Please give me a clue where to use this condition before running my script in qlikview.

Regards.

jvishnuram
Partner - Creator III
Partner - Creator III

Hi Abc,

You can use your queries same as below.,

LOAD F1,

     F2

FROM

[Sample.xls]

(biff, embedded labels, table is Sheet1$) where Match(F1,'A','B','C'); // Match is same as LIKE function in SQL

LOAD F1,

     F2

FROM

[Sample.xls]

(biff, embedded labels, table is Sheet1$) group by F1; Just use group by as a keyword and order by also in the same way

VJ
Not applicable
Author

Hi Vishnuram,

Thanks but I am confused here!!

I need to write this condition in my qlikview edit script on top of my Load statement....

So please suggest the script? I need to use this sample condition to reload my script?

eg:

Dashboard:

LOAD

     AGENT_ID,

     AGENTNAME,

     PRNT_ID,

     PARENT_NAME,

     x,

     y,

     z

     FROM

(--------------------------------------------------------------------------------------)

Where

Update Dashboard at_main

set AGENT_ID =

(

select at.PRNT_ID from Dashboard at

inner join

(select PARENT_NAME,max(STARTDATE) as max_STARTDATE

from Dashboard at1

group by PARENT_NAME) as parent

on at.PARENT_NAME = parent.PARENT_NAME

and at.STARTDATE = parent.max_STARTDATE 

AND at.PARENT_NAME like '%'+ LEFT(at_main.Agentname,20)+'%');