SQL PASS BAC - 60 reporting tips in 60 minutes

Preview:

Citation preview

60 Reporting Tips in 60 Minutes

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

Partner

Crafting Bytes

SSRS: HTML color picker websites

SSRS: Skip GIS, use MorgueFile

SSMS: Query Shortcuts

SELECT COUNT(*) FROM

SELECT TOP 100 * FROM

SSMS: Don’t forget the splitter bar

SSMS: Comment Shortcut Key

CTRL-K, C

CTRL-K, U

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.

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]

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

)

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.

SSIS: The proper way to execute an SSIS package

Power BI - Visualization: Bad Dashboard

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!

Power BI -Visualization: Stephen Few

Power BI - Visualization: Cynthia Brewer

Power BI: Tips for Visualization

Make the most important information the biggest

Put it in the upper-left corner

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

No + symbol needed

No ISNULL needed

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

Search Schema: Object Explorer Details

F7

Search Schema: T-SQL

select object_name(object_id), definition as name

from sys.all_sql_modules

where definition like '%cust%'

Search Schema: SQL Search - Free

SSDT: Search options

Spotlight

T-SQL: Use windowing functions

Neat evolution

Lifehack: Presentation tip

T-SQL: Prettify!

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

RedGate PlugIn for SQL Server Management Studio

TSQL: Or use SQLPrompt - RedGate

T-SQL: Execute scripts over multiple servers

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

Lifehack: Motorcyclist signaling cop to other motorcyclist

Looks like a siren on top!

T-SQL: Try_Cast

Avoiding terrible casting errors

T-SQL: Never reinvent the wheel – SQL#

Take SQL# for example

Good Documentation

Easy Syntax

Cheap (and much of it is free)

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

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

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.

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.

Lifehack: Today’s most precious commodity – FOCUS!

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

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

Manage: Alias, Obscure, and De-couple

Views, Aliases

Lifehack: Keep notes daily on what you doMakes CVs easier

Makes reviews easier

Makes promotions easier

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

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

Management: Use Active Directory for report security and cube securityUser

Active Directory Group

Permission

One group – One Report

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

Manage: Interview one person at a time when gathering requirements

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

Lifehack: If you want ambient light, do this

SSAS: Change one thing at a time

And break calculations down to their simplest form, deploy,

test, and change one more thing.

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

SSRS: Use a report footer

Put row count there

SSRS: Report footer

Put executive sponsor there & email address

Data mart: Use friendly names everywhereUse spaces and long names

Manage: Use a wiki for taxonomy

Record owner

Record changes

Record technical calculation

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.

Career: Learn in a group

SSMS: Status bar on top

SSMS: Color the status bar

Excel: Defer Layout Update

SSAS – Prevent load and delay when using

pivot tables.

Excel: Four Directional Arrow for custom sort

Excel: Sorting is by level

Excel: Filter – Keep only selected items

And hide selected item.

Notice the total changes.

Excel: Member Search

SSMS: Script parameters

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

Works in Chrome, SSDT, SSMS, Excel, Everywhere

SSMS: Quickly alias columns

CTRL-ALT-DOWNARROW for block selection

Manage: How to share passwords

LAST TIP! My YouTube Channel!

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

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

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

for attending this

session and the

PASS Business

Analytics

Conference 2015

ThankYou

Recommended