Data Quality Improvement

1 Data Governance

1 reference link

Youzan Data Governance Improves Quality and Reduces Costs-Knowledge

2 Data quality inspection rules

1 Decline for several consecutive cycles

select 
    count(1)
from 
    (
        select
            dh,
            sum(go_in) as cnt
        from
            table_name
        where
            concat(dt,dh) >= '$[yyyymmddhh24-3/24]'
            and concat(dt,dh) <= '$[yyyymmddhh24-1/24]'
        group by 
            dh
    ) aa -- 当前周期
join
    (
        select
            dh,
            sum(go_in) as cnt
        from
            table_name
        where
            concat(dt,dh) >= '$[yyyymmddhh24-27/24]'
            and concat(dt,dh) <= '$[yyyymmddhh24-25/24]'
        group by 
            dh
    ) bb -- 上个周期
    on aa.dh = bb.dh
where
    aa.cnt < bb.cnt -- 下降判断
    and (1- aa.cnt/bb.cnt) > 0.05 -- 下降幅度判断
;


Guess you like

Origin blog.csdn.net/weixin_40829577/article/details/123556494
Recommended