how to compute the kpi using sql
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


how to compute the kpi using sql Expand / Collapse
Author
Message
Posted 8/19/2007 10:50:30 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/29/2008 4:04:39 AM
Posts: 5, Visits: 17
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?
Post #8609
Posted 8/23/2007 7:03:17 AM
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 8/20/2008 2:31:00 AM
Posts: 53, Visits: 10
hi,
Make use of union..


Regds,
sachin
Post #8656
Posted 8/23/2007 8:30:36 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/29/2008 4:04:39 AM
Posts: 5, Visits: 17

thanks for your reply, sachin,
if i want to get the kpi of 200707,
do you mean i should do it like this :

select serv_id from serv_t
minus
(select serv_id from cdr_t where stat_month = 200707
union
select serv_id from cdr_t where stat_month = 200706
union
select serv_id from cdr_t where stat_month = 200705)
minus
(select serv_id from serv_t
minus
(select serv_id from cdr_t where stat_month = 200707
union
select serv_id from cdr_t where stat_month = 200706
......
union
select serv_id from cdr_t where stat_month = 200608)
)
Post #8659
Posted 8/30/2007 5:30:27 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 10/7/2008 6:20:30 PM
Posts: 136, Visits: 11
I believe Teradata Window Based function can address your problem.
Look up for OLAP functions in SQL reference manuals.

Thanks,
Vinay Bagare
Post #8745
Posted 8/30/2007 9:51:14 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 11/29/2008 4:04:39 AM
Posts: 5, Visits: 17
Thank you,Vinay Bagare,I will find it right now.
Post #8751
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 2 ( 2 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 3:45pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.031. 9 queries. Compression Disabled.