Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 100

OLAP SQL - running count/total - response (1) by nealvenna

$
0
0

Below is the solution and answer is inspired from 

Dieter Answer  from the link below

 

https://forums.teradata.com/forum/database/olap-function-csum-sum-with-reset-value

 

select cal_date, 

  holiday_flag, 

 sum(holiday_flag) over(order by cal_date  RESET WHEN holiday_flag =  0 rows unbounded preceding )

as count_num from dim_date


Viewing all articles
Browse latest Browse all 100

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>