You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@kylin.apache.org by lk_hadoop <lk...@163.com> on 2019/11/08 02:34:37 UTC

Kylin Hybrids Cont distinct got wrong value

hi , all :
    I have a Measure with Cont distinct algorithm , when I use a Hybrid ,The Hybrid include two cube, each cube have one years data , I can't get the meaningful result when across two year. 

   -- get each year Cont distinct Measure value 
SELECT ENT_NAME, ORD_YEAR ,SUM(PAID_IN_AMT) AS sum_PAID_IN_AMT, COUNT(DISTINCT TGOODS_ID) AS count_d_TGOODS_ID
FROM gjst.SH_FETCH_SALE_BASE_FACT_ALL_NEW2
WHERE ENT_NAME IN ('仁泰')
AND ORD_YEAR IN ('2018','2019')
GROUP BY ENT_NAME, ORD_YEAR
    
     ENT_NAME  |  ORD_YEAR  |   SUM_PAID_IN_AMT   |COUNT_D_TGOODS_ID
        仁泰                   2019                   186483922.94                7087
        仁泰                   2018                   236461205.81                9418

    -- get two year aggregation value
        SELECT ENT_NAME ,SUM(PAID_IN_AMT) AS sum_PAID_IN_AMT, COUNT(DISTINCT TGOODS_ID) AS count_d_TGOODS_ID
        FROM gjst.SH_FETCH_SALE_BASE_FACT_ALL_NEW2
        WHERE ENT_NAME IN ('仁泰')
        AND ORD_YEAR IN ('2018','2019')
        GROUP BY ENT_NAME

    ENT_NAME  |    SUM_PAID_IN_AMT   |COUNT_D_TGOODS_ID
        仁泰                   422945128.75                      9418

Is there any way to resolve it ? 

2019-11-08


lk_hadoop