mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 16:17:13 +01:00
join on website event for date ranges
This commit is contained in:
parent
1438231898
commit
33662f9f5e
1 changed files with 14 additions and 10 deletions
|
|
@ -27,11 +27,13 @@ async function relationalQuery(
|
||||||
when data_type = 4 then ${getDateSQL('date_value', 'hour')}
|
when data_type = 4 then ${getDateSQL('date_value', 'hour')}
|
||||||
else string_value
|
else string_value
|
||||||
end as "value",
|
end as "value",
|
||||||
count(*) as "total"
|
count(distinct d.session_id) as "total"
|
||||||
from session_data
|
from website_event e
|
||||||
where website_id = {{websiteId::uuid}}
|
join session_data d
|
||||||
and created_at between {{startDate}} and {{endDate}}
|
on d.session_id = e.session_id
|
||||||
and data_key = {{propertyName}}
|
where e.website_id = {{websiteId::uuid}}
|
||||||
|
and e.created_at between {{startDate}} and {{endDate}}
|
||||||
|
and d.data_key = {{propertyName}}
|
||||||
${filterQuery}
|
${filterQuery}
|
||||||
group by value
|
group by value
|
||||||
order by 2 desc
|
order by 2 desc
|
||||||
|
|
@ -54,11 +56,13 @@ async function clickhouseQuery(
|
||||||
multiIf(data_type = 2, replaceAll(string_value, '.0000', ''),
|
multiIf(data_type = 2, replaceAll(string_value, '.0000', ''),
|
||||||
data_type = 4, toString(date_trunc('hour', date_value)),
|
data_type = 4, toString(date_trunc('hour', date_value)),
|
||||||
string_value) as "value",
|
string_value) as "value",
|
||||||
count(*) as "total"
|
uniq(d.session_id) as "total"
|
||||||
from session_data final
|
from website_event e
|
||||||
where website_id = {websiteId:UUID}
|
join session_data d final
|
||||||
and created_at between {startDate:DateTime64} and {endDate:DateTime64}
|
on d.session_id = e.session_id
|
||||||
and data_key = {propertyName:String}
|
where e.website_id = {websiteId:UUID}
|
||||||
|
and e.created_at between {startDate:DateTime64} and {endDate:DateTime64}
|
||||||
|
and d.data_key = {propertyName:String}
|
||||||
${filterQuery}
|
${filterQuery}
|
||||||
group by value
|
group by value
|
||||||
order by 2 desc
|
order by 2 desc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue