O'Reilly logo

Teradata SQL by Tom Coffing, Mike Larkins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11 - OLAP Functions

“The best we can do is size up the chances, calculate the risks involved, estimate our ability to deal with them, and then make our plans with confidence.”

- Henry Ford

 

On-Line Analytical Processing (OLAP) or Ordered Analytics

images

OLAP is often called Ordered Analytics because the first thing every OLAP does before any calculating is SORT all the rows. The query above sorts by Sale_Date!

 

Cumulative Sum (CSUM) Command and how OLAP Works

SELECT      Product_ID , Sale_Date, Daily_Sales

                    ,CSUM(Daily_Sales, Sale_Date) AS “CSum”

FROM         Sales_Table ;

 

Not all rows are displayed in this answer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required