Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- author: awroblewski [AT] windowslive.com
- as part of SQL Server Reporting Services online training
- see more: https://www.youtube.com/channel/UCv0niq_2CLH-EFxWC5bpI8w
- */
- use [WideWorldImportersDW]
- go
- select
- sum(FS.[Total Including Tax]) as kwota,
- format(FS.[Delivery Date Key], 'yyyy-MM') as RokMiesiac,
- DE.Employee,
- DC.Country,
- DC.[State Province]
- from [Fact].[Sale] as FS
- join [Dimension].[Employee] DE ON FS.[Salesperson Key] = DE.[Employee Key]
- join [Dimension].[City] DC ON FS.[City Key] = DC.[City Key]
- WHERE [Delivery Date Key] is not null
- AND DE.Employee in ('Amy Trefl', 'Archer Lamble', 'Sophia Hinton')
- AND DC.[State Province] in ('Alaska', 'California' /* 'Iowa', 'Kansas' */)
- group by
- format(FS.[Delivery Date Key], 'yyyy-MM')
- ,DE.Employee,
- DC.Country,
- DC.[State Province]
- order by RokMiesiac, Employee
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement