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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Yulia
Contributor
Contributor

Load data from database in cycle with parametr in SQL part

Hello everyone!

I am pretty new in using QS and need for your help!

I need to load data from clickhouse by partitions without using qvd files. For better understanding let me show you the current way: 

 

Load appear_date,
uid;

SQL
SELECT uid, min(event_datetime) as appear_datetime
from database
and event_date > '2019-03-31' and event_date < '2019-07-01'
GROUP BY uid;

Load appear_date,
uid
where not exists(uid);

SQL
SELECT uid, min(event_datetime) as appear_datetime
from database
and event_date > '2019-07-01' and event_date < '2019-11-01'
GROUP BY uid

So, i load uids with min date for period '2019-03-31' - < '2019-07-01' and in second part i load uids with min date for the period shifted for 3 months, but only those uids that not exist in the first load. 

How can i do the same in cycle? Meaning that i should shift dates for 3 months inside the SQL-statement and check if uids don't exist in previous loads?

Thanks in advance!

1 Reply
Yulia
Contributor
Contributor
Author

Solved.