Aggregates in Teradata


Aggregates in Teradata


I have a daily aggregate table, which gives details about customer's activity - existing, new etc. There is a new requirement to identify customers who are "reactivated" within a certain time period.

To pre-build an aggregate table for reactivation customers based on a specific time period is easy - say 45 or 60 or n # of days. This is easy..

But there is a need to build an aggregate table to find all "reactivation" customers let us say in the last 2 weeks or last 3 weeks or last 3 days. This means that a dynamic list has to be prepared using daily level aggregation and it wont be a static table. Is there an easy way of building it in Teradata? I think in Oracle, we can use materialized views.

Appreciate your response.


Re: Aggregates in Teradata

You have Daily table which has UPI (id, date_valid).

You have Code table which has UPI (period_id).

You have view (or another Daily table if you wish to keep the history) with "flag columns" for each period_id specified in Code table.

Basically you specify time periods in Code table and in view you flag customers that were reactivated in specific time period (period_id) by looking into Daily table.