Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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