Вы находитесь на странице: 1из 3

Previous Next

Example: Rank Nodes


Rank nodes help you partition the data source for a set of partition columns and
then perform an order by SQL operation on the partitioned set.

For example, consider a business scenario where you want to retrieve the top five
sales for each product using the SALES_TRANSACTION data source.

SALES_TRANSACTIONS
CUSTOMER_ID

PRODUCT

PRODUCT_SALES

C1

P1

1000

C7

P5

1000

C1

P1

3000

C2

P2

3000

C2

P1

2500

C2

P4

1900

C3

P3

2100

C4
P1

2000

C5

P1

3050

C5

P4

3100

C6

P2

4000

Add SALES_TRANSACTION as a data source within the rank node and define the
following:
Threshold Value = 5
Partition By Column = PRODUCT
Order By Column = PRODUCT_SALES
When you execute the rank node, the output of the rank node is:

CUSTOMER_ID

PRODUCT

PRODUCT_SALES

C7

P5

1000

C5

P4

3100

C2

P4

1900

C3

P3

2100
C6

P2

4000

C2

P2

3000

C5

P1

3050

C1

P1

3000

C2

P1

2500

C4

P1

2000

C1

P1

1000

Вам также может понравиться