add new filter for checking if profile is set or generated

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-04-27 16:09:35 +02:00
parent 4059dad727
commit 64b2e84aeb
2 changed files with 16 additions and 0 deletions

View File

@@ -112,6 +112,15 @@ export function getEventFiltersWhereClause(filters: IChartEventFilter[]) {
if (value.length === 0) return;
if (name === 'has_profile') {
if (value.includes('true')) {
where[id] = `profile_id != device_id`;
} else {
where[id] = `profile_id = device_id`;
}
return;
}
if (name.startsWith('properties.')) {
const whereFrom = `mapValues(mapExtractKeyLike(properties, ${escape(
name.replace(/^properties\./, '').replace('.*.', '.%.')