Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

60 reporting tips in 60 minutes - SQLBits 2018

599 views

Published on

Presentation to SQLBits 2018. For report writers that use PowerBI, T-SQL, Excel, SSRS, SSIS, and SSMS

Published in: Technology
  • Be the first to comment

  • Be the first to like this

60 reporting tips in 60 minutes - SQLBits 2018

  1. 1. 60 Reporting Tips in 60 Minutes Ike Ellis Partner Crafting Bytes
  2. 2. SSMS: Query Shortcuts • SELECT COUNT(*) FROM • SELECT TOP 100 * FROM
  3. 3. SSMS: Don’t forget the splitter bar
  4. 4. SSMS: Comment Shortcut Key CTRL-K, C CTRL-K, U --select * from sales.customers c --join sales.orders o --on c.custid = o.custid
  5. 5. Three Ways to Search Schema: F7 Object Explorer Details select object_name(object_id), definition as name from sys.all_sql_modules where definition like '%cust%'
  6. 6. SSDT and SSMS: Search options Spotlight
  7. 7. SSMS: USE DATABASE • CTRL-U • Type database • Hit Enter
  8. 8. SSMS: Status bar on top
  9. 9. SSMS: Use the middle mouse button to close tabs Close windows fast Works in Chrome, SSDT, SSMS, Excel, Everywhere z z
  10. 10. SSMS: Color the status bar
  11. 11. SSMS: Drag Columns Over
  12. 12. SSMS: Performance Dashboard • Added to Standard Reports
  13. 13. SSMS: Quickly alias columns
  14. 14. Excel: Four Directional Arrow for custom sort
  15. 15. Excel: Sorting is by level
  16. 16. Excel: Filter – Keep only selected items And hide selected item. Notice the total changes.
  17. 17. Excel: Member Search
  18. 18. EXCEL: FORMULA TEXT
  19. 19. EXCEL: F-9 key
  20. 20. EXCEL: Fun with AutoNumbering
  21. 21. EXCEL: Named Dataset
  22. 22. Excel: Defer Layout Update SSAS – Prevent load and delay when using pivot tables.
  23. 23. EXCEL: Fun with the aggregate toolbar
  24. 24. T-SQL: No reason to use ISNULL  CONCAT! • Messy vs clean code • No + symbol needed • No ISNULL needed
  25. 25. T-SQL: Use windowing functions Neat evolution
  26. 26. T-SQL: Testing and Refactoring with EXCEPT Keyword ;with FreightTotal as ( select custid, sum(freight) as totalFreight from sales.orders group by custid ) select o.custid , o.freight , ft.totalFreight as totalFreight from sales.orders o join FreightTotal ft on o.custid = ft.custid EXCEPT select custid , freight , sum(freight) over (partition by custid) as totalFreight
  27. 27. T-SQL: Life is so easy with a dates table Find the sales numbers for the first Monday of every month of the year T-SQL with no dates table T-SQL with dates table
  28. 28. T-SQL: Prettify! http://extras.sqlservercentral.com/prettifier/prettifier.aspx RedGate PlugIn for SQL Server Management Studio
  29. 29. TSQL: Or use SQLPrompt - RedGate
  30. 30. T-SQL: Execute scripts over multiple servers
  31. 31. T-SQL: Try_Cast • Avoiding terrible casting errors
  32. 32. T-SQL: Never reinvent the wheel – SQL# Take SQL# for example Good Documentation Easy Syntax Cheap (and much of it is free)
  33. 33. T-SQL: Save scripts in a project for easy navigation
  34. 34. T-SQL: Fight Dependencies - Alias, Obscure, and De-couple Views, Aliases
  35. 35. T-SQL: Check for heaps/clustered indexes SELECT t.[Name] FROM sys.Indexes i JOIN sys.Tables t ON t.Object_ID = i.Object_id WHERE i.type_desc = 'HEAP' ORDER BY t.[Name]
  36. 36. T-SQL: Index all the keys select object_name(c.object_id), c.name from sys.columns c where c.name like '%id' and c.object_id not in ( select object_id from sys.index_columns )
  37. 37. SSRS: Skip GIS, use MorgueFile
  38. 38. SSRS: Log, Log, Log (and beware of subscriptions) select c.Name , e.InstanceName , e.UserName , e.Parameters , e.TimeStart , e.TimeEnd , e.TimeDataRetrieval , e.TimeProcessing , e.TimeRendering from executionlog e join catalog c on e.reportid = c.ItemID Send a Link, or a file on a shared folder that you can audit. Find someway to audit who opened the link or the file in the folder. Try to avoid sending the PDF without a way to audit it.
  39. 39. SSRS: Store colors in the database Colors = Business Logic Put it in the database Use Expressions to read the colors Include action colors and levels
  40. 40. Colors from logo • https://html-color-codes.info/colors-from-image/#
  41. 41. SSRS: Store Formats in the Database
  42. 42. SSRS: Get Buy-in to Export to Single Format • Build to export to a single format • Excel • Word • Web • PDF • Then get buy-in and make it a standard in the organization
  43. 43. SSRS: Used Linked Reports to Manage Security • Allows you to use Role assignments and • Not have duplicate reports in folders • Not have users in folders they shouldn’t be in • Not manage security on individual reports
  44. 44. SSRS: Use a report footer • Put executive sponsor there & email address • Date Executed • Parameters Used • Date Created • Date Modified • Put row count there
  45. 45. SSRS: Use a wiki for taxonomy Record owner Record changes Record technical calculation
  46. 46. SSIS: The proper way to execute an SSIS package
  47. 47. Power BI - Visualization: Bad Dashboard
  48. 48. Power BI - Visualization: Use color sparingly. In nature, colors do two things: 1) Entice 2) Warn So let’s use them sparingly.. WARNING: POISON FROG!
  49. 49. Power BI -Visualization: Stephen Few
  50. 50. Power BI - Visualization: Cynthia Brewer
  51. 51. Power BI: Tips for Visualization • Make the most important information the biggest • Put it in the upper-left corner
  52. 52. Ike wants good evals!
  53. 53. Power BI: Use bookmarks to clear filters
  54. 54. Power BI: Use bookmarks to create a portal • https://www.blue-granite.com/blog/create-an-app-like-experience- in-power-bi-with-bookmarks
  55. 55. Power BI: Text To Image Converter • https://www.branah.com/text-to-image
  56. 56. Power BI: Use bookmarks for pagination • https://community.powerbi.com/t5/Data-Stories-Gallery/Pagination- in-Power-BI-Reports-utilizing-Bookmarking/td-p/325702
  57. 57. Power BI: Express Route
  58. 58. Power BI: Contests https://powerbi.microsoft.com/en-us/blog/tag/contest/
  59. 59. Power BI: Look how easy R is to use!
  60. 60. Power BI: Let’s use R with Power BI
  61. 61. Wrapping Up: Keep Report Quantity Small Too many reports means that there are more things to keep consistent Reports that aren’t used, tend to get forgotten, and then used with bad data
  62. 62. Wrapping Up: Interview one person at a time when gathering requirements
  63. 63. Wrapping Up: Find the key person • They know a lot • They have time • They respond quickly • They are most often right • They might not be likeable, and that’s OK • Success – Work in their office
  64. 64. Wrapping Up: Change one thing at a time And break calculations down to their simplest form, deploy, test, and change one more thing.
  65. 65. Wrapping Up: Very few KPIs and numbers! "The well-intentioned desire to be great at everything is precisely what leads to exhausted mediocrity" https://www.youtube.com/watch?v=DWKvSG_9s5I" Walmart customer service
  66. 66. Wrapping Up: Use friendly names everywhere Use spaces and long names
  67. 67. Wrapping Up: If you want ambient light, do this
  68. 68. Wrapping Up: Have the child call you Whenever someone comes around saying "Would you like to buy blah blah blah, my kid is going to do whatever." I tell them, "Yes, I would love to! But your child has to be the one to ask me." I then give them my number and say the child can call anytime after 6pm.
  69. 69. Wrapping Up: How to share passwords
  70. 70. Wrapping Up: MUTE BUTTON IN CHROME chrome://flags/#enable-tab-audio-muting
  71. 71. LAST TIP! My YouTube Channel! https://www.youtube.com/user/IkeEllisData
  72. 72. Contact Me! http://www.craftingbytes.com http://blog.ikeellis.com http://www.ikeellis.com YouTube http://www.youtube.com/user/IkeEllisData San Diego Tech Immersion Group http://www.sdtig.com Twitter: @ike_ellis 619.922.9801 ike@craftingbytes.com
  73. 73. Just like Jimi Hendrix … We love to get feedback Please complete the session feedback forms
  74. 74. SQLBits - It's all about the community... Please visit Community Corner, we are trying this year to get more people to learn about the SQL Community, equally if you would be happy to visit the community corner we’d really appreciate it.

×