0 - 5 of 5 tags for dense_rank
Select Region,Store,Sales,
   Rank()over(partition by Region Order by sales desc) as SalesRank 
from SalesTable 
Qualify SalesRank>=4

Input	
Region	Store	Sales	SalesRank
2	821	82224	1
2	615	5323	2
2	143	5323	2
2	242	4123	4

Desired Output	
Region	Store	Sales	SalesRank
2	821	82224	1
2	615	5323	2
2	143	5323	2
2	242	4123	3

Hi All,

 

Order by Behavior is different in DB2 and Teradata 

 

I already tried adding Case specific which doesn’t work for my project related data .

 

Here is the main query modified (table-name etc for security reasons and its output Demo Data but similar to main one )

I'm looking to rank the number of a specific call based on the volume of calls that precede it within a 30 day window prior to the current call.  The challenge ... I am ranking calls over a long period of time so the 30 day predeing window is not fixed.  Essentially it is a running total count on a 30 day rolling window.

For every Sale_Month, I would like to get the top 3 Item_Types for each Employee_Name dense ranked based on the on the Num_Sales. Currently I am getting "Modified competition ranking" instead of Dense Ranking"

Dense ranking ("1223" ranking)

Modified competition ranking ("1334" ranking)

 

How can I change my SQL to get "Dense Ranking" instead of "Modified competition ranking"?

SELECT *
From (

Some of the SQL:2008 analytical functions are not implemented in Teradata, but most of them can be re-written using existing features.
In this post I will cover the ranking algorithms including DENSE_RANK.