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: 
ivandrago
Creator II
Creator II

Script Help ideas

Hi,
I have the below query in sql server 2005, how would I create a qvd file for this as not sure how to handle inline views?

select
tablea.appointmentNo,
tablea.son,
tablea.PersonId,
case when app.callno is null then 0 else 1 end as LastCall,
cus.queue

from
tablea

left outer join (select son, max(appointmentNo) as lastAppointmentNo from tableb group by son) app
on tablea.son = app.son
and tablea.appointmentNo = app.lastAppointmentNo

left outer join (select son, queue, FixFromOpen from tablec union select son, queue,FixFromOpen from tabled
where not exists (select * from TableD z where z.callNo = tablec.CallNo)) cus
on tablea.son = cus.son


where
tablea.status='Live'

Thanks

1 Solution

Accepted Solutions
Not applicable

Sure. My Semi-coloning might not be totally accurate. I'm writing this on the fly.



[My Table Name]:
LOAD
*;
SQL SELECT
tablea.appointmentNo,
tablea.son,
tablea.PersonId,
case when app.callno is null then 0 else 1 end as LastCall,
cus.queue

from
tablea

left outer join (select son, max(appointmentNo) as lastAppointmentNo from tableb group by son) app
on tablea.son = app.son
and tablea.appointmentNo = app.lastAppointmentNo

left outer join (select son, queue, FixFromOpen from tablec union select son, queue,FixFromOpen from tabled
where not exists (select * from TableD z where z.callNo = tablec.CallNo)) cus
on tablea.son = cus.son


where
tablea.status='Live';


View solution in original post

5 Replies
ivandrago
Creator II
Creator II
Author

Any experts out there? That can tell me if this can be done or not?

Not applicable

Hi Ivan,

Perhaps I'm misunderstanding, but if you have the SQL query why don't you do one of these:

1) define it as a view in SQL and pull data from the view

2) inside your LOAD statement, just SQL SELECT the whole query you've just posted here

either of these will load the data from the query you've provided.

ivandrago
Creator II
Creator II
Author

Hi, I want to avoid creating a view in sql server, how would you do 2) can you provide a starting example?

Thanks

Not applicable

Sure. My Semi-coloning might not be totally accurate. I'm writing this on the fly.



[My Table Name]:
LOAD
*;
SQL SELECT
tablea.appointmentNo,
tablea.son,
tablea.PersonId,
case when app.callno is null then 0 else 1 end as LastCall,
cus.queue

from
tablea

left outer join (select son, max(appointmentNo) as lastAppointmentNo from tableb group by son) app
on tablea.son = app.son
and tablea.appointmentNo = app.lastAppointmentNo

left outer join (select son, queue, FixFromOpen from tablec union select son, queue,FixFromOpen from tabled
where not exists (select * from TableD z where z.callNo = tablec.CallNo)) cus
on tablea.son = cus.son


where
tablea.status='Live';


ivandrago
Creator II
Creator II
Author

Thanks Fry!