New to Qlik Analytics

If you’re new to Qlik Cloud or Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More

Who Me Too'd this topic

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!

Who Me Too'd this topic