Grafana红移-错误:由于内部错误,不支持这种类型的相关子查询模式



我在Grafana的Redshift上遇到一个查询,在添加特定的where子句时,会出现上述错误。如果没有这个where子句,它做得很好。此外,如果我们放置一个直接值,比如first_week>2,那么就不会出现错误。

where子句:

WHERE first_week >= EXTRACT(YEAR FROM $__timeFrom AT TIME ZONE 'UTC')

from  
(select a.distinct_id, a.login_week, b.first_week as first_week, a.login_week 
first_week as week_number 
from (select distinct_id, EXTRACT(WEEK FROM timestamp AT TIME ZONE 'UTC') AS login_week from posthog_event where distinct_id IN ( select distinct_id from activated_user) group by 1, 2) a, 
select distinct_id, MIN(EXTRACT(WEEK FROM timestamp AT TIME ZONE 'UTC')) AS first_week from posthog_event where distinct_id IN ( select distinct_id from activated_user) group by 1) b 
where a.distinct_id = b.distinct_id
) as with_week_number 
where first_week>= EXTRACT(YEAR FROM '2022-03-01T17:01:18Z' AT TIME ZONE 'UTC')
group by first_week order by first_week

知道我哪里错了吗?或者可以做些什么来添加where子句。

https://grafana.com/grafana/plugins/grafana-redshift-datasource/

$__timeFrom((用引号输出面板范围的当前开始时间

>Grafana宏是$__timeFrom(),而不仅仅是$__timeFrom,所以正确的条件是:

WHERE first_week >= EXTRACT(YEAR FROM $__timeFrom() AT TIME ZONE 'UTC')

和往常一样:医生是你的好朋友

相关内容

最新更新