Teradata Advanced OLAP Functions

40
Teradata Advanced OLAP functions

Transcript of Teradata Advanced OLAP Functions

Page 1: Teradata Advanced OLAP Functions

Teradata Advanced OLAP functions

Page 2: Teradata Advanced OLAP Functions

RANK function

The RANK function is a Teradata specific function which assigns a ranking order to rows in a qualified answer set

Example:

Arrange the employees according to their employee number. Assign ranks to

them based to the same. empno ename

1 vidhya

2 badri

3 ravikanth

4 priti

5 anjan

6 francis

7 srikanth

Page 3: Teradata Advanced OLAP Functions

empno ename RN

1 vidhya 1

2 badri 2

3 ravikanth 3

4 priti 4

5 anjan 5

6 francis 6

7 srikanth 7

Query:select empno, ename,rank() OVER ( ORDER BY empno ) AS RN from emp

The ORDER BY clause in this construct is associated with the RANK function. A rank by definition implies an ordering on a particular column or expression. The ORDER BY clause tells on what is being ranked

Output:

Page 4: Teradata Advanced OLAP Functions

4Trianz, Inc. Confidential

ROW_NUMBER function

The ROW_NUMBER function returns the sequential row number of a group starting with the number one The ROW_NUMBER function returns the sequential row number of a group starting with the number one. The ROW_NUMBER function: is the same as the ANSI RANK function except in the event of a tie. doesn't report duplicate values like RANK

Page 5: Teradata Advanced OLAP Functions

Query:

select empno, ename,ROW_NUMBER() OVER (ORDER BY empno DESC) AS RN from emp

9 srikanth 18 badri 27 srikanth 36 francis 45 anjan 54 priti 63 ravikanth 72 badri 81 vidhya 9

Page 6: Teradata Advanced OLAP Functions

Rank sales of item 10 by day between the two specified dates using the Row_Number function.

SELECT itemid, salesdate, sales,RANK() OVER (ORDER BY sales DESC) WHERE salesdate BETWEEN DATE '2004-01-01' AND DATE '2004-03-01‘

AND itemid = 10 FROM daily_sales_2004 ;

itemid salesdate sales Rank(sales)----------- ---------- ----------- ----------- 10 2004-01-10 550.00 1 10 2004-02-17 550.00 1 10 2004-02-20 450.00 3 10 2004-02-06 350.00 4 10 2004-02-27 350.00 4 10 2004-01-05 350.00 4 10 2004-01-03 250.00 7 10 2004-02-03 250.00 7 10 2004-01-25 200.00 9 10 2004-01-02 200.00 9 10 2004-01-21 150.00 11 10 2004-02-01 150.00 11 10 2004-01-01 150.00 11 10 2004-01-31 100.00 14

Page 7: Teradata Advanced OLAP Functions

Rank sales of item 10 by day between the two specified dates using the Row_Number function.

SELECT itemid, salesdate, sales,ROW_NUMBER() OVER (ORDER BY sales DESC) WHERE salesdate BETWEEN DATE '2004-01-01' AND DATE '2004-03-01'AND itemid = 10FROM daily_sales_2004;

itemid salesdate sales Row_Number()----------- ---------- ----------- ------------ 10 2004-01-10 550.00 1 10 2004-02-17 550.00 2 10 2004-02-20 450.00 3 10 2004-02-06 350.00 4 10 2004-02-27 350.00 5 10 2004-01-05 350.00 6 10 2004-01-03 250.00 7 10 2004-02-03 250.00 8 10 2004-01-25 200.00 9 10 2004-01-02 200.00 10 10 2004-01-21 150.00 11 10 2004-02-01 150.00 12 10 2004-01-01 150.00 13 10 2004-01-31 100.00 14

Page 8: Teradata Advanced OLAP Functions

RANK OVER PARTITION

Find out the rank by partitioning by employee names and order by emp no.

Query:select empno, ename,rank() OVER (partition by ename ORDER BY empno ) AS RN from emp

So within each non-unique names, the rank will be calculated and arrangedBy employee number. 5 anjan 1

2 badri 18 badri 26 francis 14 priti 13 ravikanth 17 srikanth 19 srikanth 21 vidhya 1

Page 9: Teradata Advanced OLAP Functions

Qualify function:

select empno, ename,rank() OVER ( partition by ename ORDER BY empno ) AS RN from emp qualify RN <2

Qualify is supposed to be used instead of where function.

empno ename RN5 anjan 12 badri 16 francis 14 priti 1

3ravikanth 1

7 srikanth 11 vidhya 1

Page 10: Teradata Advanced OLAP Functions

empno ename salary7 srikanth 40009 srikanth 40005 anjan 20003 ravikanth 40001 vidhya 40008 badri 10006 francis 30004 priti 20002 badri 1000

Introducing another column salary in the table by altering the tablealter table empadd salary decimal (10,2)

Insert values as below

Page 11: Teradata Advanced OLAP Functions

Rank the employees based on salary.

select empno, ename,salary,rank() OVER (ORDER BY salary ) AS RN from emp

Output: empno ename salary RN8 badri 1000 12 badri 1000 14 priti 2000 3

5anjan 2000 3

6francis 3000 5

3ravikanth 4000 6

9srikanth 4000 6

1vidhya 4000 6

7srikanth 4000 6

Page 12: Teradata Advanced OLAP Functions

Rank the employees within each salary group.Sort by arranging in descending employee number.

Query:select empno, ename,salary,rank() OVER (partition by salary ORDER BY ename desc ) AS RN from emp

empno ename salary RN2 badri 1000 18 badri 1000 14 priti 2000 15 anjan 2000 26 francis 3000 11 vidhya 4000 17 srikanth 4000 29 srikanth 4000 2

3ravikanth 4000 4

Page 13: Teradata Advanced OLAP Functions

Create the following table and insert values as given in the next slide. It will be useful in understanding the coming functions.

CREATE SET TABLE sales,NO FALLBACK,CHECKSUM = DEFAULT,LOG(store_no INTEGER,sale_month DATE,prod_code CHAR (20) CHARACTER SET LATIN NOT CASESPECIFIC,projected_sale INTEGER,actual_sale INTEGER)PRIMARY INDEX ( store_no )

Page 14: Teradata Advanced OLAP Functions

INSERT INTO sales values (10,'2007-01-01','Apple',15000,13000);INSERT INTO sales values (20,'2007-02-01','Banana',10000,11000);INSERT INTO sales values (30,'2007-03-01','Orange',11000,10500);INSERT INTO sales values (40,'2007-04-01','Apricot',12500,12500);INSERT INTO sales values (50,'2007-05-01','Grapes',15000,12500);INSERT INTO sales values (60,'2007-06-01','Apple',12000,11500);INSERT INTO sales values (70,'2007-07-01','Banana',15500,11500);INSERT INTO sales values (80,'2007-08-01','Grapes',15000,15500);INSERT INTO sales values (90,'2007-06-01','Orange',16000,15500);INSERT INTO sales values (10,'2007-05-01','Apricot',14500,13500);INSERT INTO sales values (20,'2007-04-01','Mango',15500,12500);INSERT INTO sales values (30,'2007-03-01','Mango',15000,12500);INSERT INTO sales values (40,'2007-02-01','Guava',14000,11500);INSERT INTO sales values (50,'2007-01-01','Guava',12000,10500);INSERT INTO sales values (30,'2007-02-01','Strawberry',12000,10000);

Page 15: Teradata Advanced OLAP Functions

Find the moving average of actual sales within each store.Use Rows 1 preceding option.

Query:

SELECT store_no, sale_month, actual_sale, projected_sale, AVG(actual_sale) OVER (PARTITION BY store_no ORDER BY sale_month ROWS 1 PRECEDING)FROM sales;

Page 16: Teradata Advanced OLAP Functions

16Trianz, Inc. Confidential

store_no sale_month actual_sale projected_sale Moving Avg(actual_sale)10 1/1/2007 13000 15000 1300010 5/1/2007 13500 14500 1325020 2/1/2007 11000 10000 1100020 4/1/2007 12500 15500 1175030 2/1/2007 10000 12000 1000030 3/1/2007 10500 11000 1025030 3/1/2007 12500 15000 1150040 2/1/2007 11500 14000 1150040 4/1/2007 12500 12500 1200050 1/1/2007 10500 12000 1050050 5/1/2007 12500 15000 1150060 6/1/2007 11500 12000 1150070 7/1/2007 11500 15500 1150080 8/1/2007 15500 15000 1550090 6/1/2007 15500 16000 15500

13500+13000/2

Page 17: Teradata Advanced OLAP Functions

SELECT store_no, sale_month, actual_sale, projected_sale, AVG(actual_sale) OVER (PARTITION BY store_no ORDER BY projected_sale ROWS 1 PRECEDING)FROM sales; store_no sale_month actual_sale

projected_sale

Moving Avg(actual_sale)

10 5/1/2007 13500 14500 1350010 1/1/2007 13000 15000 1325020 2/1/2007 11000 10000 1100020 4/1/2007 12500 15500 1175030 3/1/2007 10500 11000 1050030 2/1/2007 10000 12000 1025030 3/1/2007 12500 15000 1125040 4/1/2007 12500 12500 1250040 2/1/2007 11500 14000 1200050 1/1/2007 10500 12000 1050050 5/1/2007 12500 15000 1150060 6/1/2007 11500 12000 1150070 7/1/2007 11500 15500 1150080 8/1/2007 15500 15000 1550090 6/1/2007 15500 16000 15500

Page 18: Teradata Advanced OLAP Functions

Find the minimum of actual sales within each store within every three sale months.

SELECT store_no, sale_month, actual_sale, projected_sale, min(actual_sale) OVER (PARTITION BY store_no ORDER BY sale_month ROWS 2 PRECEDING)FROM sales;

Page 19: Teradata Advanced OLAP Functions

19Trianz, Inc. Confidential

store_no sale_month actual_sale projected_saleMoving Min(actual_sale)

10 1/1/2007 13000 15000 1300010 5/1/2007 13500 14500 1300020 2/1/2007 11000 10000 1100020 4/1/2007 12500 15500 1100030 2/1/2007 10000 12000 1000030 3/1/2007 10500 11000 1000030 3/1/2007 12500 15000 1000040 2/1/2007 11500 14000 1150040 4/1/2007 12500 12500 1150050 1/1/2007 10500 12000 1050050 5/1/2007 12500 15000 1050060 6/1/2007 11500 12000 1150070 7/1/2007 11500 15500 1150080 8/1/2007 15500 15000 1550090 6/1/2007 15500 16000 15500

OUTPUT:

10000 IS

MIN

Page 20: Teradata Advanced OLAP Functions

Find out the total actual sales in stores for current and previous month.(Here previous need not be the immediate previous month)

SELECT store_no, sale_month, actual_sale, projected_sale, sum(actual_sale) OVER (PARTITION BY store_no ORDER BY sale_month ROWS 1 PRECEDING)FROM sales;

Page 21: Teradata Advanced OLAP Functions

21Trianz, Inc. Confidential

store_no sale_monthactual_sale

projected_sale

Moving Sum(actual_sale)

10 1/1/2007 13000 15000 1300010 5/1/2007 13500 14500 2650020 2/1/2007 11000 10000 1100020 4/1/2007 12500 15500 2350030 2/1/2007 10000 12000 1000030 3/1/2007 10500 11000 2050030 3/1/2007 12500 15000 2300040 2/1/2007 11500 14000 1150040 4/1/2007 12500 12500 2400050 1/1/2007 10500 12000 1050050 5/1/2007 12500 15000 2300060 6/1/2007 11500 12000 1150070 7/1/2007 11500 15500 1150080 8/1/2007 15500 15000 1550090 6/1/2007 15500 16000 15500

Page 22: Teradata Advanced OLAP Functions

ASSIGNING THE PREVIOUS VALUE FOR THE NEXT ONE.

SELECT store_no, sale_month, actual_sale, projected_sale, min(actual_sale) OVER (PARTITION BY store_no ORDER BY sale_month ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING )FROM sales;

store_no sale_month actual_saleprojected_sale Moving Avg(actual_sale)

10 1/1/2007 13000 15000 ?10 5/1/2007 13500 14500 1300020 2/1/2007 11000 10000 ?20 4/1/2007 12500 15500 1100030 2/1/2007 10000 12000 ?30 3/1/2007 10500 11000 1000030 3/1/2007 12500 15000 1050040 2/1/2007 11500 14000 ?40 4/1/2007 12500 12500 1150050 1/1/2007 10500 12000 ?50 5/1/2007 12500 15000 1050060 6/1/2007 11500 12000 ?70 7/1/2007 11500 15500 ?80 8/1/2007 15500 15000 ?90 6/1/2007 15500 16000 ?

Page 23: Teradata Advanced OLAP Functions

SELECT store_no, sale_month, actual_sale, projected_sale, AVG(actual_sale) OVER (PARTITION BY store_no ORDER BY sale_month ROWS BETWEEN 2 PRECEDING AND 2 PRECEDING )FROM sales;

store_no sale_month actual_saleprojected_sale Moving Avg(actual_sale)

10 1/1/2007 13000 15000?10 5/1/2007 13500 14500?20 2/1/2007 11000 10000?20 4/1/2007 12500 15500?30 2/1/2007 10000 12000?30 3/1/2007 10500 11000?30 3/1/2007 12500 15000 1000040 2/1/2007 11500 14000?40 4/1/2007 12500 12500?50 1/1/2007 10500 12000?50 5/1/2007 12500 15000?60 6/1/2007 11500 12000?70 7/1/2007 11500 15500?80 8/1/2007 15500 15000?90 6/1/2007 15500 16000?

Page 24: Teradata Advanced OLAP Functions

INSERT INTO sales values(30,'2007-04-01','pear',14000,15000)

INSERT INTO sales values(30,'2007-04-01','lichi',14500,16000)Now the table looks like the below given one.store_no sale_month prod_code projected_sale actual_sale

40 4/1/2007 Apricot 12500 12500

30 3/1/2007 Orange 11000 10500

40 2/1/2007 Guava 14000 11500

30 3/1/2007 Mango 15000 12500

80 8/1/2007 Grapes 15000 15500

30 2/1/2007 Strawberry 12000 10000

20 2/1/2007 Banana 10000 11000

30 4/1/2007 pear 14000 15000

20 4/1/2007 Mango 15500 12500

30 4/1/2007 lichi 14500 16000

60 6/1/2007 Apple 12000 11500

70 7/1/2007 Banana 15500 11500

90 6/1/2007 Orange 16000 15500

10 1/1/2007 Apple 15000 13000

10 5/1/2007 Apricot 14500 13500

50 5/1/2007 Grapes 15000 12500

50 1/1/2007 Guava 12000 10500

Page 25: Teradata Advanced OLAP Functions

Show average sales of all products in all stores with a moving average using the two preceding rows but partitioning by store number.

SELECT store_no, sale_month, actual_sale, projected_sale, AVG(actual_sale) OVER (PARTITION BY store_no ORDER BY sale_month ROWS BETWEEN 2 PRECEDING AND CURRENT ROW ) where store_no=30FROM sales;

store_no sale_month actual_saleprojected_sale Moving Avg(actual_sale)

30 2/1/2007 10000 12000 1000030 3/1/2007 10500 11000 1025030 3/1/2007 12500 15000 1100030 4/1/2007 16000 14500 1300030 4/1/2007 15000 14000 14500

10000+10500+12500/

3

Page 26: Teradata Advanced OLAP Functions

SELECT store_no, sale_month, actual_sale, projected_sale, avg(actual_sale) OVER (PARTITION BY store_no ORDER BY sale_month ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING ) where store_no=30FROM sales;

store_no sale_month actual_saleprojected_sale

Moving Avg(actual_sale)

30 2/1/2007 10000 12000 10250

30 3/1/2007 10500 11000 11500

30 3/1/2007 12500 15000 14250

30 4/1/2007 16000 14500 15500

30 4/1/2007 15000 14000 15000

Here the first row=10000+10500

/2

Page 27: Teradata Advanced OLAP Functions

Calculate the total actual sales of fruits by category per each store: SELECT store_no, prod_code, actual_sale,SUM (actual_sale) OVER (PARTITION BY store_no ROWS BETWEENUNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as FruitTotalFROM sales;

store_no prod_code actual_sale FruitTotal10Apricot 13500 2650010Apple 13000 26500

20Mango 12500 23500

20Banana 11000 23500

30Strawberry 10000 64000

30lichi 16000 6400030pear 15000 64000

30Mango 12500 64000

30Orange 10500 6400040Guava 11500 2400040Apricot 12500 2400050Grapes 12500 2300050Guava 10500 2300060Apple 11500 11500

70Banana 11500 11500

80Grapes 15500 1550090Orange 15500 15500

Simply the average is taken for each partition

and written across

Page 28: Teradata Advanced OLAP Functions

Calculate the cumulative actual sales per store ordered by sale month:

SELECT store_no, sale_month, actual_sale,SUM (actual_sale) OVER (PARTITION BY store_no ORDER BY sale_month ROWS UNBOUNDED PRECEDING) as StoreTotalFROM sales;

store_no sale_month actual_sale StoreTotal10 1/1/2007 13000 1300010 5/1/2007 13500 2650020 2/1/2007 11000 1100020 4/1/2007 12500 2350030 2/1/2007 10000 1000030 3/1/2007 10500 2050030 3/1/2007 12500 3300030 4/1/2007 16000 4900030 4/1/2007 15000 6400040 2/1/2007 11500 1150040 4/1/2007 12500 2400050 1/1/2007 10500 1050050 5/1/2007 12500 2300060 6/1/2007 11500 1150070 7/1/2007 11500 1150080 8/1/2007 15500 1550090 6/1/2007 15500 15500

Page 29: Teradata Advanced OLAP Functions

Calculate the moving actual sales per month per store.

SELECT store_no, sale_month, actual_sale,SUM (actual_sale) OVER (PARTITION BY store_no, sale_month ORDER BY actual_sale ROWS 1 PRECEDING) as SaleTrendFROM saleswhere store_no in (10,30,20)

store_no sale_month actual_sale SaleTrend10 1/1/2007 13000 1300010 5/1/2007 13500 1350020 2/1/2007 11000 1100020 4/1/2007 12500 1250030 2/1/2007 10000 1000030 3/1/2007 10500 1050030 3/1/2007 12500 2300030 4/1/2007 15000 1500030 4/1/2007 16000 31000

Within each month,moving

sales is calculated

Page 30: Teradata Advanced OLAP Functions

Find the rank over the stores by their actual sales.

SELECT store_no, sale_month, actual_sale,RANK () OVER (PARTITION BY store_no ORDER BY actual_sale) as SaleRankFROM saleswhere store_no in (10,30)

store_no sale_month actual_sale SaleRank

10 1/1/2007 13000 1

10 5/1/2007 13500 2

30 2/1/2007 10000 1

30 3/1/2007 10500 2

30 3/1/2007 12500 3

30 4/1/2007 15000 4

30 4/1/2007 16000 5

Page 31: Teradata Advanced OLAP Functions

Show sales of all products in all stores partitioned by store with a remaining minimum using the current and following

rows. SELECT storeid, prodid, sales,

MIN(sales) OVER (PARTITION BY storeid ORDER BY sales DESC ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)FROM salestbl ;

storeid prodid sales Remaining Min(sales)----------- ------ ----------- --------------------

1001 D 35000.00 35000.00 1001 C 60000.00 35000.00 1001 A 100000.00 35000.00 1001 F 150000.00 35000.00 1002 D 25000.00 25000.00 1002 C 35000.00 25000.00 1002 A 40000.00 25000.00 1003 C 20000.00 20000.00 1003 A 30000.00 20000.00 1003 D 50000.00 20000.00 1003 B 65000.00 20000.00

Page 32: Teradata Advanced OLAP Functions

Advanced Ranking Functions

RANK Review

The RANK function is a Teradata specific function which assigns a ranking order to rows in a qualified answer set

Example

Rank the top three products across all stores by revenue. Use ANSI RANK syntax to accomplish this. SELECT storeid, prodid, sales, RANK() OVER (ORDER BY sales DESC) AS

Rank_Sales FROM salestbl QUALIFY rank_sales <= 3;

storeid prodid sales Rank_Sales----------- ------ ----------- -----------1001 F 150000.00 11001 A 100000.00 21003 B 65000.00 3

The ORDER BY clause in this construct is associated with the RANK function. A rank by definition implies an ordering on a particular column or expression. The ORDER BY clause tells what is being ranked (i.e. sales) and the DESC options starts the ranking with the highest sales value.

Page 33: Teradata Advanced OLAP Functions

Qualified Ranking

Example Show a ranking of the top three products in each store and the revenue generated by

them in each store.

SELECT storeid, prodid, sales, RANK()OVER (PARTITION BY storeid ORDER BY sales DESC)AS Rank_SalesFROM salestblQUALIFY Rank_Sales <= 3;

storeid  prodid sales Rank_Sales

-------  -------- -------- ---------

1001  F 150000.00 1

1001  A 100000.00 2

1001  C 60000.00 3

1002  A 40000.00 1

1002  C 35000.00 2

1002  D 25000.00 3

1003  B 65000.00 1

1003  D 50000.00 2

1003  A 30000.00 3

Page 34: Teradata Advanced OLAP Functions

RANK With Aggregation

Low Order Ranking

A low-order ranking is accomplished by changing the ORDER BY clause of the RANK function from descending to ascending.

Page 35: Teradata Advanced OLAP Functions

SELECT store_no, sale_month, actual_sale,RANK () OVER (PARTITION BY store_no ORDER BY actual_sale) as SaleRankFROM salesqualify Salerank = 5

store_no sale_month actual_sale SaleRank

30 4/1/2007 16000 5

Page 36: Teradata Advanced OLAP Functions

36Trianz, Inc. Confidential

CSUM-Cumulative Sum

Accumulates a sum over an ordered set of rows, providing the current values of the SUM on each row

Syntax:

CSum(value_expression, sort_expression_list)

SELECT store_no, sale_month,

actual_sale,

csum(actual_sale,store_no)

FROM sales

store_no sale_month actual_sale

CSum(actual_sale,store_no)

10 1/1/2007 13000 1300010 5/1/2007 13500 2650020 2/1/2007 11000 3750020 4/1/2007 12500 5000030 2/1/2007 10000 6000030 4/1/2007 16000 7600030 4/1/2007 15000 9100030 3/1/2007 10500 10150030 3/1/2007 12500 11400040 2/1/2007 11500 12550040 4/1/2007 12500 13800050 1/1/2007 10500 14850050 5/1/2007 12500 16100060 6/1/2007 11500 17250070 7/1/2007 11500 18400080 8/1/2007 15500 19950090 6/1/2007 15500 215000

Page 37: Teradata Advanced OLAP Functions

37Trianz, Inc. Confidential

MSUM-Moving Sum

Description

Computes the moving sum of a column using the current row and the preceding n-1 row.

Syntax:

MSum(value_expression, width, sort_expression_list)

SELECT store_no, sale_month,

actual_sale,

msum(actual_sale,2,store_no)

FROM sales

store_no sale_month actual_saleMSum(actual_sale,2,store_no)

10 1/1/2007 13000 1300010 5/1/2007 13500 2650020 4/1/2007 12500 2600020 2/1/2007 11000 2350030 4/1/2007 15000 2600030 4/1/2007 16000 3100030 2/1/2007 10000 2600030 3/1/2007 10500 2050030 3/1/2007 12500 2300040 4/1/2007 12500 2500040 2/1/2007 11500 2400050 1/1/2007 10500 2200050 5/1/2007 12500 2300060 6/1/2007 11500 2400070 7/1/2007 11500 2300080 8/1/2007 15500 2700090 6/1/2007 15500 31000

Page 38: Teradata Advanced OLAP Functions

38Trianz, Inc. Confidential

MSUM-Moving Sum

Returns the moving difference between the current row-column value and the preceding nth value.

The moving difference is a common business metric used to compare activity for some variable in a current time period to the activity for the same variable in another time period at a fixed distance in the past.

Syntax: MDiff(value_expression, width,

sort_expression_list)

SELECT store_no, sale_month,

actual_sale,

mdiff(actual_sale,1,store_no)

FROM sales

store_no sale_month actual_saleMDiff(actual_sale,1,store_no)

10 1/1/2007 13000 ?10 5/1/2007 13500 50020 4/1/2007 12500 -100020 2/1/2007 11000 -150030 4/1/2007 15000 400030 4/1/2007 16000 100030 2/1/2007 10000 -600030 3/1/2007 10500 50030 3/1/2007 12500 200040 4/1/2007 12500 040 2/1/2007 11500 -100050 1/1/2007 10500 -100050 5/1/2007 12500 200060 6/1/2007 11500 -100070 7/1/2007 11500 080 8/1/2007 15500 400090 6/1/2007 15500 0

Page 39: Teradata Advanced OLAP Functions

THANK YOU!!!!

Page 40: Teradata Advanced OLAP Functions

40Trianz, Inc. Confidential