how to compute the kpi using sql

Analytics
N/A

how to compute the kpi using sql

Hi,I need to compute a kpi named "Low-grade Silent Customers"
which means customers that haven't use our specific service for
3 months to 1 year.In our data warehouse,we store specific service
usage records in separate tables by month,and each table has more
than one hundred million recodes,who can give me a smart sql?
2 REPLIES

Re: how to compute the kpi using sql

A bit late but maybe you can try to look in the following direction:
select distinct customers from month_12_table
union
select distinct customers from month_11_table
union
.....
.....
union
select distinct customers from month_3_table
minus
select distinct customers from month_2_table
minus
select distinct customers from month_1_table
minus
select distinct customers from month_0_table
N/A

Re: how to compute the kpi using sql

thanks,ohuibers,
i haved solved the problem the same way as your advice