SQL PASS BAC - 60 reporting tips in 60 minutes

70
60 Reporting Tips in 60 Minutes April 20 - 22, 2015 | Santa Clara, CA Ike Ellis Partner Crafting Bytes

Transcript of SQL PASS BAC - 60 reporting tips in 60 minutes

Page 1: SQL PASS BAC - 60 reporting tips in 60 minutes

60 Reporting Tips in 60 Minutes

April 20 - 22, 2015 | Santa Clara, CAIke Ellis

Partner

Crafting Bytes

Page 2: SQL PASS BAC - 60 reporting tips in 60 minutes

SSRS: HTML color picker websites

Page 3: SQL PASS BAC - 60 reporting tips in 60 minutes

SSRS: Skip GIS, use MorgueFile

Page 4: SQL PASS BAC - 60 reporting tips in 60 minutes

SSMS: Query Shortcuts

SELECT COUNT(*) FROM

SELECT TOP 100 * FROM

Page 5: SQL PASS BAC - 60 reporting tips in 60 minutes

SSMS: Don’t forget the splitter bar

Page 6: SQL PASS BAC - 60 reporting tips in 60 minutes

SSMS: Comment Shortcut Key

CTRL-K, C

CTRL-K, U

Page 7: SQL PASS BAC - 60 reporting tips in 60 minutes

Lifehack: Start 2014 with a jar and fill it with notes of good things that happen

Next New Year’s Eve, empty the jar and see what awesome

stuff happened that year.

Page 8: SQL PASS BAC - 60 reporting tips in 60 minutes

Performance: Check for heaps/clustered indexesSELECT 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]

Page 9: SQL PASS BAC - 60 reporting tips in 60 minutes

Performance: 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

)

Page 10: SQL PASS BAC - 60 reporting tips in 60 minutes

Lifehack: Readable Presentations

Take the average age of the people in your audience and

divide by 2: That’s your font size

Do you want to know what I think you’re average is? My font size is

typically 20 – 24.

Page 11: SQL PASS BAC - 60 reporting tips in 60 minutes

SSIS: The proper way to execute an SSIS package

Page 12: SQL PASS BAC - 60 reporting tips in 60 minutes

Power BI - Visualization: Bad Dashboard

Page 13: SQL PASS BAC - 60 reporting tips in 60 minutes

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!

Page 14: SQL PASS BAC - 60 reporting tips in 60 minutes

Power BI -Visualization: Stephen Few

Page 15: SQL PASS BAC - 60 reporting tips in 60 minutes

Power BI - Visualization: Cynthia Brewer

Page 16: SQL PASS BAC - 60 reporting tips in 60 minutes

Power BI: Tips for Visualization

Make the most important information the biggest

Put it in the upper-left corner

Page 17: SQL PASS BAC - 60 reporting tips in 60 minutes

T-SQL: No reason to use ISNULL CONCAT!Messy vs clean code

No + symbol needed

No ISNULL needed

Page 18: SQL PASS BAC - 60 reporting tips in 60 minutes

Lifehack: If you backpack, but need news, search Wikipedia by month & year

Page 19: SQL PASS BAC - 60 reporting tips in 60 minutes

Search Schema: Object Explorer Details

F7

Page 20: SQL PASS BAC - 60 reporting tips in 60 minutes

Search Schema: T-SQL

select object_name(object_id), definition as name

from sys.all_sql_modules

where definition like '%cust%'

Page 21: SQL PASS BAC - 60 reporting tips in 60 minutes

Search Schema: SQL Search - Free

Page 22: SQL PASS BAC - 60 reporting tips in 60 minutes

SSDT: Search options

Spotlight

Page 23: SQL PASS BAC - 60 reporting tips in 60 minutes

T-SQL: Use windowing functions

Neat evolution

Page 24: SQL PASS BAC - 60 reporting tips in 60 minutes

Lifehack: Presentation tip

Page 25: SQL PASS BAC - 60 reporting tips in 60 minutes

T-SQL: Prettify!

http://extras.sqlservercentral.com/prettifier/prettifier.aspx

RedGate PlugIn for SQL Server Management Studio

Page 26: SQL PASS BAC - 60 reporting tips in 60 minutes

TSQL: Or use SQLPrompt - RedGate

Page 27: SQL PASS BAC - 60 reporting tips in 60 minutes

T-SQL: Execute scripts over multiple servers

Page 28: SQL PASS BAC - 60 reporting tips in 60 minutes

Tip: 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

Page 29: SQL PASS BAC - 60 reporting tips in 60 minutes

Lifehack: Motorcyclist signaling cop to other motorcyclist

Looks like a siren on top!

Page 30: SQL PASS BAC - 60 reporting tips in 60 minutes

T-SQL: Try_Cast

Avoiding terrible casting errors

Page 31: SQL PASS BAC - 60 reporting tips in 60 minutes

T-SQL: Never reinvent the wheel – SQL#

Take SQL# for example

Good Documentation

Easy Syntax

Cheap (and much of it is free)

Page 32: SQL PASS BAC - 60 reporting tips in 60 minutes

LIfehack: If you take a power strip to the airport during the winter, you’ll be a hero

Page 33: SQL PASS BAC - 60 reporting tips in 60 minutes

T-SQL: Save scripts in a project for easy navigation

Page 34: SQL PASS BAC - 60 reporting tips in 60 minutes

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.

Page 35: SQL PASS BAC - 60 reporting tips in 60 minutes

Performance: Big linesWhen troubleshooting, thick rows means lots of data, thin rows mean not much data.

You’re probably better off following the thick rows.

Page 36: SQL PASS BAC - 60 reporting tips in 60 minutes

Lifehack: Today’s most precious commodity – FOCUS!

Page 37: SQL PASS BAC - 60 reporting tips in 60 minutes

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

Page 38: SQL PASS BAC - 60 reporting tips in 60 minutes

SSRS: Get Buy-in to Export to Single FormatBuild to export to a single format

• Excel

• Word

• Web

• PDF

Then get buy-in and make it a standard in the organization

Demo: Build to export to excel

Page 39: SQL PASS BAC - 60 reporting tips in 60 minutes

Manage: Alias, Obscure, and De-couple

Views, Aliases

Page 40: SQL PASS BAC - 60 reporting tips in 60 minutes

Lifehack: Keep notes daily on what you doMakes CVs easier

Makes reviews easier

Makes promotions easier

Page 41: SQL PASS BAC - 60 reporting tips in 60 minutes

SSAS: Views are better than DSVs

• Easier to manage

• Can use SQL Search tools

• Can use SQL Dependency Tools

• Have a set of views only used by analysis services..so you

can change them without telling anyone else

Page 42: SQL PASS BAC - 60 reporting tips in 60 minutes

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

Page 43: SQL PASS BAC - 60 reporting tips in 60 minutes

Management: Use Active Directory for report security and cube securityUser

Active Directory Group

Permission

One group – One Report

Page 44: SQL PASS BAC - 60 reporting tips in 60 minutes

Management: Keep Report Quantity SmallToo 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

Page 45: SQL PASS BAC - 60 reporting tips in 60 minutes

Manage: Interview one person at a time when gathering requirements

Page 46: SQL PASS BAC - 60 reporting tips in 60 minutes

Manage: 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

Page 47: SQL PASS BAC - 60 reporting tips in 60 minutes

Lifehack: If you want ambient light, do this

Page 48: SQL PASS BAC - 60 reporting tips in 60 minutes

SSAS: Change one thing at a time

And break calculations down to their simplest form, deploy,

test, and change one more thing.

Page 49: SQL PASS BAC - 60 reporting tips in 60 minutes

Manage: 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

Page 50: SQL PASS BAC - 60 reporting tips in 60 minutes

SSRS: Use a report footer

Put row count there

Page 51: SQL PASS BAC - 60 reporting tips in 60 minutes

SSRS: Report footer

Put executive sponsor there & email address

Page 52: SQL PASS BAC - 60 reporting tips in 60 minutes

Data mart: Use friendly names everywhereUse spaces and long names

Page 53: SQL PASS BAC - 60 reporting tips in 60 minutes

Manage: Use a wiki for taxonomy

Record owner

Record changes

Record technical calculation

Page 54: SQL PASS BAC - 60 reporting tips in 60 minutes

Lifehack: 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.

Page 55: SQL PASS BAC - 60 reporting tips in 60 minutes

Career: Learn in a group

Page 56: SQL PASS BAC - 60 reporting tips in 60 minutes

SSMS: Status bar on top

Page 57: SQL PASS BAC - 60 reporting tips in 60 minutes

SSMS: Color the status bar

Page 58: SQL PASS BAC - 60 reporting tips in 60 minutes

Excel: Defer Layout Update

SSAS – Prevent load and delay when using

pivot tables.

Page 59: SQL PASS BAC - 60 reporting tips in 60 minutes

Excel: Four Directional Arrow for custom sort

Page 60: SQL PASS BAC - 60 reporting tips in 60 minutes

Excel: Sorting is by level

Page 61: SQL PASS BAC - 60 reporting tips in 60 minutes

Excel: Filter – Keep only selected items

And hide selected item.

Notice the total changes.

Page 62: SQL PASS BAC - 60 reporting tips in 60 minutes

Excel: Member Search

Page 63: SQL PASS BAC - 60 reporting tips in 60 minutes

SSMS: Script parameters

Page 64: SQL PASS BAC - 60 reporting tips in 60 minutes

Windows: Use the middle mouse button to close tabsClose windows fast

Works in Chrome, SSDT, SSMS, Excel, Everywhere

Page 65: SQL PASS BAC - 60 reporting tips in 60 minutes

SSMS: Quickly alias columns

CTRL-ALT-DOWNARROW for block selection

Page 66: SQL PASS BAC - 60 reporting tips in 60 minutes

Manage: How to share passwords

Page 67: SQL PASS BAC - 60 reporting tips in 60 minutes

LAST TIP! My YouTube Channel!

https://www.youtube.com/user/IkeEllisData

Page 68: SQL PASS BAC - 60 reporting tips in 60 minutes

Contact Me!

http://blog.ikeellis.com

http://www.ikeellis.com

YouTube • http://www.youtube.com/user/IkeEllisData

SQL Pass Book Readers • http://bookreaders.sqlpass.org/

San Diego Tech Immersion Group

Twitter: @ike_ellis

619.922.9801

Email address is just my first name @ikeellis.com

Page 69: SQL PASS BAC - 60 reporting tips in 60 minutes

Your feedback

is important

and valuable.

Submit by

11:59 PM PT,

April 30, 2015 to

WIN prizes

Session Evaluations

Go to

passbac2015/evals

Download the PASS

EVENT App from

your App Store and

search: PASS BAC

2015

Follow the QR code

link displayed on

session signage and

in the program

guide

Page 70: SQL PASS BAC - 60 reporting tips in 60 minutes

for attending this

session and the

PASS Business

Analytics

Conference 2015

ThankYou