Let me post this question to calcite community and see what they say. On Fri, Apr 10, 2015 at 6:04 PM, dong wang <[email protected]> wrote:
> select sum(dau) / (select sum(dau) from test1 where stat_date>'2015-04-02' > and stat_date<'2015-04-10') from test1 where stat_date='2015-04-09' > > or > > select sum(dau), (select sum(dau) from test1 where stat_date>'2015-04-02' > and stat_date<'2015-04-10') from test1 where stat_date='2015-04-09' > > NONE of the above works~ > > > 2015-04-10 17:18 GMT+08:00 Luke Han <[email protected]>: > > > Hi Dong, > > Could you please try subquery for this? > > Thanks. > > Luke > > > > > > Best Regards! > > --------------------- > > > > Luke Han > > > > 2015-04-10 17:02 GMT+08:00 dong wang <[email protected]>: > > > > > suppose we have metrics > > > > > > sum(a)/sum(b) > > > > > > sum(a): today's new users count > > > sum(b): previous 7 days(including today)' new users count > > > > > > in my views, it should belong to query planner component for a standard > > > olap engine, if we can create temp tables, we can split the query for > the > > > above metrics into multiple sqls, however, it seems that kylin doesn't > > > support creating temp table to store the intermediate result, thus, can > > we > > > support the above complex metrics with kylin now? > > > > > >
