mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 17:45:38 +01:00
template multiple queries for filtering
This commit is contained in:
parent
3494ae46b7
commit
cb4368e12c
4 changed files with 66 additions and 14 deletions
|
|
@ -111,7 +111,25 @@ async function clickhouseQuery(
|
|||
groupByQuery = 'group by x';
|
||||
}
|
||||
|
||||
// let excludeDomain = '';
|
||||
// if (column === 'referrer_domain') {
|
||||
// excludeDomain = `and referrer_domain != {websiteDomain:String} and referrer_domain != ''`;
|
||||
// }
|
||||
|
||||
return rawQuery(
|
||||
// `
|
||||
// select ${column} x, count(*) y
|
||||
// from website_event
|
||||
// where website_id = {websiteId:UUID}
|
||||
// and created_at between {startDate:DateTime64} and {endDate:DateTime64}
|
||||
// and event_type = {eventType:UInt32}
|
||||
// ${excludeDomain}
|
||||
// ${filterQuery}
|
||||
// group by x
|
||||
// order by y desc
|
||||
// limit ${limit}
|
||||
// offset ${offset}
|
||||
// `,
|
||||
`
|
||||
select g.t as x,
|
||||
count(*) as y
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue