Advertisement
awroblewski

SSRS_OnlineTraining_1

May 24th, 2020
664
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.83 KB | None | 0 0
  1. /*
  2. author: awroblewski [AT] windowslive.com
  3. as part of SQL Server Reporting Services online training
  4. see more: https://www.youtube.com/channel/UCv0niq_2CLH-EFxWC5bpI8w
  5. */
  6.  
  7. use [WideWorldImportersDW]
  8. go
  9.  
  10. select
  11. sum(FS.[Total Including Tax]) as kwota,
  12. format(FS.[Delivery Date Key], 'yyyy-MM') as RokMiesiac,
  13. DE.Employee,
  14. DC.Country,
  15. DC.[State Province]
  16. from [Fact].[Sale] as FS
  17. join [Dimension].[Employee] DE ON FS.[Salesperson Key] = DE.[Employee Key]
  18. join [Dimension].[City] DC ON FS.[City Key] = DC.[City Key]
  19. WHERE [Delivery Date Key] is not null
  20. AND DE.Employee in ('Amy Trefl', 'Archer Lamble', 'Sophia Hinton')
  21. AND DC.[State Province] in ('Alaska', 'California' /* 'Iowa', 'Kansas' */)
  22. group by
  23. format(FS.[Delivery Date Key], 'yyyy-MM')
  24. ,DE.Employee,
  25. DC.Country,
  26. DC.[State Province]
  27. order by RokMiesiac, Employee
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement