All Forums Analytics
tong 5 posts Joined 12/06
18 Aug 2007
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?

ohuibers 1 post Joined 11/07
29 Nov 2007

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

tong 5 posts Joined 12/06
30 Nov 2007

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

You must sign in to leave a comment.