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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
devarshigoswami
Contributor II
Contributor II

QlikView Resident Load in SQL where clause

Thanks for taking the time to read this....
Can I add a resident load in SQL FROM clause? 

Like so ...

 

TMP:
SQL SELECT * from table WHERE date_parse(date,'%Y-%m-%d') < date_trunc('month', current_date)
and
date_parse(date,'%Y-%m-%d') >= date_trunc('month', current_date) - interval '1' month

;

Main:

SQL SELECT item, max(date) 
FROM Resident TMP
GROUP BY 1;

Labels (1)
3 Replies
MartW
Partner - Specialist
Partner - Specialist

I'm more of a Qlik Sense Guy, but I think this is not possible in neither of the Qlik products (Qlikview and or Qlik Sense)

what you could do is load the TMP table into qlik first. after that do something like Main: noconcatenate Load * resident TMP Group BY 1; and drop the TMP table with drop table TMP;

sidhiq91
Specialist II
Specialist II

@devarshigoswami Whenever you type SQL in Script Editor, Qlik will hit the SQL server to fetch the data from there.

In your Example, you don't have to mention SQL  again before the load for the 'Main' table since that data is already fetched. All that you need to do is:

Noconcatenate

Main:

Load * Resident TMP group b column_name;

vinieme12
Champion III
Champion III

If you want to process the result of another SQL, Just use a nested query!!

Main:
SQL
SELECT A.item, max(A.date) 
FROM
(SELECT * from table WHERE date_parse(date,'%Y-%m-%d') < date_trunc('month', current_date)
and
date_parse(date,'%Y-%m-%d') >= date_trunc('month', current_date) - interval '1' month
) A
Group by A.item
;

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.