Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Rizzo
Contributor II
Contributor II

Hi All

I have such SQL query wich inside has subselect statement
---------------------------
Select
A.[Type]
, B.[Exception]
, A.Item
, A.Location
, A.Date as A_Date


,(
Select TOP 1 A1.Date
From TableA as A1
Where
A1.Date >A.Date
and A1.[Type] = 1
and A1.Item = A.Item
and B.Key2 = A.Location
Order by A.Date asc
) as A1_Date

From TableA as A
Left join TableB as B on B.Key1 = A.[User]
Where A.[Type] = 7
-------------------------
The question is how to write this SQL subselect part in LOAD if my SQL query would be more simple like this
-------------------------
Select
A.[Type]
, B.[Exception]
, A.Item
, A.Location
, A.Date as A_Date
From TableA as A
Left join TableB as B on B.Key1 = A.[User]
Where A.[Type] IN (1, 7)
-------------------------

Thanks in advance 🙂

0 Replies