O'Reilly logo

V14 Certification: Teradata SQL by Tom Coffing, Leona Coffing

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 8 - OLAP Functions

“Don’t count the days, make the days count.”

– Mohammed Ali

On-Line Analytical Processing (OLAP) or Ordered Analytics

image

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 and then does a cumulative sum on the Daily_Sales column.

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 ;

image

OLAP always sorts the rows ...

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