Created
September 13, 2016 16:13
-
-
Save alittlesliceoftom/f86bade54452a3125d079b56850b25e3 to your computer and use it in GitHub Desktop.
returns final and customer demand split by weekday
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--%of demand by weekday (2015) | |
SELECT DATEPART(dw,SettlementDate) datepart, | |
DateName(dw,SettlementDate) datename | |
,SUM(CustomerDemandAggregate)/COUNT(CustomerDemandAggregate) as CdperDay | |
,SUM(FinalDemandAggregate)/COUNT(FinalDemandAggregate) as fdperDay | |
FROM [TradingDB].[Report].[FinalDemandAggregate] | |
WHERE YEAR(SettlementDate) = 2015 | |
and temperaturesetid = '2' | |
AND ProfileClassId =1 | |
Group by DateName(dw,SettlementDate), DATEPART(dw,SettlementDate) | |
ORDER by DATEPART(dw,SettlementDate) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment