Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
See why BI users voted Qlik #1 in 11 categories. GET REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Contributor
Contributor

Solved.