I. Connecting to Data
In this section, you will get started with importing data into Tableau. Tableau public has fewer options, but paid versions of Tableau are quite extensive connecting directly to databases and cloud based data storage systems.
II. Combining Data
In this section, you will learn how to connect data from multiple sources for use in your visuals. If you are comfortable with SQL joins, this section should be second nature.
III. Worksheets
The visuals you create will be stored in worksheets. This is the template we will be working in for this course.
IV. Aggregations
Tableau performs aggregations of our data by default. In this section, you will learn more about how to work with different aggregations, as well as how to break your aggregations into a more granular level of the data.
V. Hierarchies
Hierarchies allow you to 'drill' into your data and questions at different levels. One of the easiest ways to think of hierarchies is in relation to time. You could look at your data at a year, month, day, hour, or another level. Moving across these levels is considered working with hierarchies.
You can also perform hierarchical calculations in other ways. Imagine you have a different companies, with different departments, and teams within those departments. This creates a hierarchy that you might want to analyze at different levels.
VI. Marks & Filters
Filtering is one of the most powerful techniques in creating dashboards. This relates to the marks portion of a dashboard, which controls the colors, shapes and other attributes of our data. You can think of this like a WHERE statement in SQL used to filter your data to only the parts you are interested in for a specific question.
VII. Show Me
The Show Me portion of Tableau controls what your ending visual looks like. There are a lot of options here. In most cases, Tableau will guess what visual you want to create, but sometimes you might have your own ideas for implementation.
VIII. Small Multiples & Dual Axis
Small multiples & dual charts are a way to visualize data that needs to share an axis for comparison purposes. This and this are great articles for explaining how these two parts of Tableau work and why you might use them.
IX. Groups & Sets
Groups and sets are two ways to categorize our data within a visualization. The difference between these two can be confusing, but we will see when and why you would use each.
X. Calculated Fields
Often you might add these fields to your dataset before adding your data to Tableau, but sometimes you want to add them to a visualization on the fly. Many of these calculated fields are things you have probably done in a spreadsheets application like finding a total or a cost per item.
XI. Table Calculations
Table calculations are often used to perform comparisons of our data over time or between groups. A great article on table calculations is available here.
Sunday, September 9, 2018
Sunday, August 26, 2018
2. Design
- Understand the context - this means knowing your audience and conveying a clear message about what you want your audience to know or do with the information you are providing.
- Choose an appropriate visual display - this was covered in the last lesson. Check out the lesson titled recap in the previous section if you need a quick refresher.
- Eliminate clutter - you should only provide information to the user that helps convey your message.
- Focus attention where you want it - build visualizations that pull attention to the message you want to highlight.
- Think like a designer - you will learn a number of design principles in this lesson to assist as you start to put together your own data visualizations.
- Tell a story - your visualizations should give the audience a story. The most powerful data visualizations move people to take action.
- Exploratory Analysis is done when you are searching for insights. These visualizations don't need to be perfect. You are using plots to find insights, but they don't need to be aesthetically appealing. You are the consumer, and you need to be able to find the answer to your question from these plots.
- Explanatory Analysis is done when you are providing your results for others. These visualizations need to provide you the emphasis you need to convey your message. They should be accurate, insightful, and visually appealing.
- Extract - Obtain the data from a spreadsheet, SQL, the web, etc.
- Clean - Here we could use exploratory visuals.
- Explore - Here we use exploratory visuals.
- Analyze - Here we might use either exploratory or explanatory visuals.
- Share - Here is where explanatory visuals live.
- Don’t convey the message.
- Are misleading
- Examples of chart junks
- Graph with the high data-ink ratio is much easier to understand as it reduces down to a graph much simpler to understand by extracting the extraneous elements such as the background color.
- Below chart also shows: low vs. high data-ink ratio
- If the lie factor is above 1, the data is considered to be misleading.
- Before adding color to a visualization, start with black and white.
- When using color, use less intense colors - not all the colors of the rainbow, which is the default in many software applications. - use less intense colors(pastel, grey …etc.)
- Color for communication. Use color to highlight your message and separate groups of interest. Don't add color just to have color in your visualization.
- Use color pallets that do not move from red to green. Instead, use colors on a blue to orange pallet.
- Categorical: color and shape
- Qualitative: size of marker
- Maintaining a large data-ink ratio and removing unnecessary items from visuals.
- Choosing visual encodings that work to highlight insights.
- Maintaining data integrity in the visual.
- Focus the audience's attention on the insight you want them to act on.
- Use color only when necessary. Simple is often better.
- Tell a story.
- Start with a Question
- Repetition is a Good Thing
- Highlight the Answer
- Call Your Audience To Action
- How to build data visualizations for explanatory purposes.
- How visual encodings impact our abilities as humans to accurately perceive that information.
- How chart junk distracts from the message - maximize your data-ink ratio.
- How to calculate lie factors and the importance of design integrity.
- How to use more advanced design features like color, shape, and size - make sure these are truly enhancing your message!
- The importance of story telling in communicating with data.
There are two main reasons for creating
visuals using data:
The five steps
of the data analysis process:
Bad Visualization
Chart Junk
Data Ink Ratio
=
amount of ink used to describe the data/ amount of ink used to describe
everything else
The data-ink ratio,
credited to Edward Tufte, is directly related to the idea of chart junk. The
more of the ink in your visual that is related to conveying the message in the
data, the better.
Limiting
chart junk increases the data-ink ratio.
Design Integrity
Using Color
Designing for Color Blindness
Shape, Size and Other Tools
Bad
Visuals can be avoided by:
For explanatory visuals:
Focus
on SIMPLICITY!!
Tell a story
Recap
1. Intro to Data Visualization
- Histogram
- Normal Quantile Plot
- Stem and Leaf Plot
- Box and Whisker Plot
- Bar Chart
- Pie Chart
- Pareto Chart
- Correlation coefficient: the strength and direction of a linear relationship
- Commonly denoted by r (-1 < r < 1)
- +1: positive linear correlation
- -1: negative linear correlation
- 0: no linear relationship
- Strength: Weak, Moderate, Strong
- Direction: Positive, Negative, None
- Line plots are a common plot for viewing data over time.
- Allow us to quickly identify overall trends, seasonal occurrences, peaks, and valleys in the data.
- You motivated the need for data visualization by showing that summary statistics don't tell the full story. You saw datasets where the summary statistics were the same, but the actual data were very different!
- You did a review of data types. In general there are quantitative and categorical variables. Quantitative variables can be either discrete or continuous, while categorical variables are either ordinal or nominal.
- You looked at univariate plots. In most cases a histogram should be used for quantitative data, while a bar chart should be used for categorical data. There are some cases where you might use one of the other plots.
- You then looked at bivariate plots, where you were comparing two variables to one another. Scatter plots are the most common way to visualize two quantitative variables, while a line chart is common for data that you are watching over time. If you are comparing two categorical variables, the best choice is probably a side-by-side bar chart.
- You learned about correlation coefficients, which provide the strength and direction of linear relationships. You learned a rule of thumb for determining whether the relationship between two quantitative variables is strong, moderate, or weak.
- You then looked at cases where we had more than two variables. You learned that using these plots effectively is about building the plot that helps you see the insight that answers the question you have.
- You gained some insight into visual encodings and data dashboards, which will be a part of the next lessons!
For qualitative
data, if we are just looking at one column worth of data,
We have these 4
common visuals:
For categorical
data, if we are looking at just one variable(column), we have three common
visuals:
Scatter Plots
Strong Moderate Weak
0.7≤∣r∣≤1.00.7≤∣r∣≤1.0 0.3≤∣r∣<0.70.3≤∣r∣<0.7 0.0≤∣r∣<0.30.0≤∣r∣<0.3

Line Plots
Ex)
stock prices over time
Recap
Tuesday, August 14, 2018
SQL Aggregation Functions
COUNT
SUM
Min and Max
Average
NULL
: no data, different from 0 or no data
: it is a property,
so in a query, after where clause, it should be:
IS NULL
IS NOT NULL
COUNT
only counts values that are not NULL
SELECT COUNT(*)
FROM accounts;
SUM
- Can only be used with numerical values
- NULL values are considered as '0'
MIN/MAX
- Min will return the lowest number
- Max will return the highest number/ the latest date/ the non-numerical value closest alphabetically to 'z'
AVG
- Ignores NLLL values
- Can only be used for numerical data
GROUP BY
- Group by can be used to aggregate data within subsets of the data. For example, grouping for different accounts, different regions, or different sales representatives.
- Any column in the SELECT statement that is not within an aggregator must be in the GROUP BY clause.
- The GROUP BY always goes between WHERE and ORDE BY.
- ORDER BY works like SORT in spreadsheet software.
DISTINCT
- returns unique rows
HAVING
- 'clean' way to filter a query that has been aggregated, but this is also commonly done using a subquery.
- Any time you want to perform a WHERE on an element of your query that was created by an aggregate, you need to use HAVING instead.
DATE
- DATE TRUNC
CASE
SELECT account_id, CASE WHEN standard_qty = 0 OR standard_qty IS NULL THEN 0
ELSE standard_amt_usd/standard_qty END AS unit_price
FROM orders
LIMIT 10;
SUM
Min and Max
Average
NULL
: no data, different from 0 or no data
: it is a property,
so in a query, after where clause, it should be:
IS NULL
IS NOT NULL
COUNT
only counts values that are not NULL
SELECT COUNT(*)
FROM accounts;
SUM
- Can only be used with numerical values
- NULL values are considered as '0'
MIN/MAX
- Min will return the lowest number
- Max will return the highest number/ the latest date/ the non-numerical value closest alphabetically to 'z'
AVG
- Ignores NLLL values
- Can only be used for numerical data
GROUP BY
- Group by can be used to aggregate data within subsets of the data. For example, grouping for different accounts, different regions, or different sales representatives.
- Any column in the SELECT statement that is not within an aggregator must be in the GROUP BY clause.
- The GROUP BY always goes between WHERE and ORDE BY.
- ORDER BY works like SORT in spreadsheet software.
DISTINCT
- returns unique rows
HAVING
- 'clean' way to filter a query that has been aggregated, but this is also commonly done using a subquery.
- Any time you want to perform a WHERE on an element of your query that was created by an aggregate, you need to use HAVING instead.
DATE
- DATE TRUNC
CASE
SELECT account_id, CASE WHEN standard_qty = 0 OR standard_qty IS NULL THEN 0
ELSE standard_amt_usd/standard_qty END AS unit_price
FROM orders
LIMIT 10;
Friday, July 27, 2018
Basic SQL
Entity Relationship Diagram(ERD):
ERD is a common way to view data in a database.
It helps you visualize the data you are analyzing including:
SQL (Structured Query Language)
Why Do Business Choose SQL?
Types of Statements
Select & From
select *
from demo.order
Queries
LIMIT
select top 10 *
from orders;
ORDER BY
select *
from web_events
order by occurred_at desc
ERD is a common way to view data in a database.
It helps you visualize the data you are analyzing including:
- the names of the tables.
- the columns in each table
- the way the tables work together
SQL (Structured Query Language)
- easy to understand
- access data directly
- easy to audit and replicate
- multiple tables at once
- allows you to analyze more complex questions than dashboard tools like Google Analytics
Why Do Business Choose SQL?
- Data integrity is ensured.
- Data can be accessed quickly.
- Data is easily shared.
Types of Statements
- Create table: creates a new table in a database
- Drop table: removes a table in a database
- Select - query: allows you to read data and display it.
Select & From
- Select: tell the query what columns you want back.
- From: what table you are querying from.
select *
from demo.order
Queries
LIMIT
- seeing only a few lines of data
- in MySQL, used as
select top 10 *
from orders;
ORDER BY
- order out table by any row
- default: ascending order / put 'desc' at the end for descending order
select *
from web_events
order by occurred_at desc
- create an order within the order
select occurred_at, total_amt_usd
from orders
order by total_amt_usd desc, occurred_at desc
limit 5
WHERE
subset out tables based on conditions that must be met.
when finding non-numeric values, put a single quotation mark
- > (greater than)
- < (less than)
- >= (greater than or equal to)
- <= (less than or equal to)
- = (equal to)
- != (not equal to)
select *
from orders
where gloss_amt_usd > 1000
limit 5
select name, website, primary_poc
from accounts
where name = 'Exxon Mobil'
DERIVED COLUMN
common operators include:
- * (Multiplication)
- + (Addition)
- - (Subtraction)
- / (Division)
select id, account_id, standard_amt_usd/standard_qty as unit_price
from orders
limit 10
LIKE
This allows you to perform operations similar to using WHERE and =,
but for cases when you might not know exactly what you are looking for.
- Wildcards(%)
- Case-sensitive
select *
from orders
where account LIKE '%google%'
select name
from accounts
where name like 'C%'
IN
This allows you to perform operations similar to using WHERE and =,
but for more than one condition.
select name, primary_poc,sales_rep_id
from accounts
where name in ('Walmart', 'Target', 'Nordstrom')
NOT
This is used with IN and LIKE to select all of the rows NOT LIKE or NOT IN a certain condition.
select name, primary_poc,sales_rep_id
from accounts
where name NOT in ('Walmart', 'Target', 'Nordstrom')
select *
from web_events
where channel NOT in ('organic', 'adwords' )
select name
from accounts
where name not like '%s'
AND & BETWEEN
These allow you to combine operations where all combined conditions must be true.
select *
from orders
where standard_qty > 1000
and poster_qty = 0
and gloss_qty = 0
select *
from accounts
where name NOT LIKE 'C%'
AND NAME NOT LIKE '%s'
select *
from web_events
where channel in ('organic', 'adwords')
and occurred_at between '2016-01-01' and '2017-01-01'
order by occurred_at desc
OR
This allows you to combine operations where at least one of the combined conditions must be true.
select id
from orders
where gloss_qty > 4000 or poster_qty > 4000
select *
from orders
where standard_qty = 0 or (gloss_qty > 1000 or poster_qty > 1000)
select *
from accounts
where *name like 'C%' OR NAME LIKE 'W%' )
and (primary_poc LIKE '%ana%' or primary_poc LIKE '%Ana%')
and or primary_poc NOT LIKE '%eana%'
Summary
| Statement | How to Use It | Other Details |
|---|---|---|
| SELECT | SELECT Col1, Col2, ... | Provide the columns you want |
| FROM | FROM Table | Provide the table where the columns exist |
| LIMIT | LIMIT 10 | Limits based number of rows returned |
| ORDER BY | ORDER BY Col | Orders table based on the column. Used with DESC. |
| WHERE | WHERE Col > 5 | A conditional statement to filter your results |
| LIKE | WHERE Col LIKE '%me%' | Only pulls rows where column has 'me' within the text |
| IN | WHERE Col IN ('Y', 'N') | A filter for only rows with column of 'Y' or 'N' |
| NOT | WHERE Col NOT IN ('Y', 'N') | NOT is frequently used with LIKE and IN |
| AND | WHERE Col1 > 5 AND Col2 < 3 | Filter rows where two or more conditions must be true |
| OR | WHERE Col1 > 5 OR Col2 < 3 | Filter rows where at least one condition must be true |
| BETWEEN | WHERE Col BETWEEN 3 AND 5 | Often easier syntax than using an AND |
Saturday, July 21, 2018
Spreadsheets 3: Visualize Data
Pie Charts:
- Show proportions
- Divide the whole pie into different pieces
Bar Charts:
Comparing category values against other values
Scatter and Line Plots:
- Useful for displaying bivariate numerical data.
- This means a data set with two variables, such as height and weight measurements for a list of human beings.
Histogram:
- A column chart that measures the frequency of data in a data set.
- A histogram is only associated with quantitative data sets.
Box Plot:
Visualization of data statistical spread including 1st, 2nd, and 3rd quartiles plus max and min.
When you are presenting data, think about:
1. What questions are we answering?
2. What patterns are we trying to show?
3. Who is the audience?
4. Overview or in-depth?
- Show proportions
- Divide the whole pie into different pieces
Bar Charts:
Comparing category values against other values
Scatter and Line Plots:
- Useful for displaying bivariate numerical data.
- This means a data set with two variables, such as height and weight measurements for a list of human beings.
Histogram:
- A column chart that measures the frequency of data in a data set.
- A histogram is only associated with quantitative data sets.
Box Plot:
Visualization of data statistical spread including 1st, 2nd, and 3rd quartiles plus max and min.
When you are presenting data, think about:
1. What questions are we answering?
2. What patterns are we trying to show?
3. Who is the audience?
4. Overview or in-depth?
Thursday, July 19, 2018
Spreadsheets2: Analyze Data
Aggregation Functions
= A1 + B1 + C1
= SUM(A1:C1)
SUM/ AVERAGE/ MAX/ MIN/ MEDIAN/ STANDARD DEVIATION(stdev)
Logical Functions
=IF(condition, value if TRUE, [value if FALSE])
=IF(AND(condition1, condition2, ...), value if TRUE, [value if FALSE])
Otherwise, mark it with "No".
AND: true if all conditions are true
OR: true if any condition is true
NOT: reverses true and false
ex)
=IF(OR(MAX(B2:D2)>10, SUM(B2:D2)>20), "Special Order", "No")
If the maximum number of any one fruit exceeds 10 pieces in an order,
or the total order exceeds 20 pieces (all fruit),
then mark it with "Special Order".
Otherwise, mark it with "No".
Conditional Aggregation Functions
COUNTIF
=countif(A:A, "=apple")
SUMIF
Named Ranges
Creating named ranges is a lot more readable and easier to maintain.
How to create named ranges:
Formulas> Define Name
Vlookup: a function that uses a keyword and index to "look up" a value in a table
=VLOOKUP(A2,airline_lookup, 2, FALSE)
1) selecting a cell
2) selecting the range you are referring to -> here I used named ranges
3) Index of the column you are referring to
4) False -> exact match
True -> similar match
= A1 + B1 + C1
= SUM(A1:C1)
SUM/ AVERAGE/ MAX/ MIN/ MEDIAN/ STANDARD DEVIATION(stdev)
Logical Functions
=IF(condition, value if TRUE, [value if FALSE])
=IF(AND(condition1, condition2, ...), value if TRUE, [value if FALSE])
Otherwise, mark it with "No".
AND: true if all conditions are true
OR: true if any condition is true
NOT: reverses true and false
ex)
=IF(OR(MAX(B2:D2)>10, SUM(B2:D2)>20), "Special Order", "No")
If the maximum number of any one fruit exceeds 10 pieces in an order,
or the total order exceeds 20 pieces (all fruit),
then mark it with "Special Order".
Otherwise, mark it with "No".
Conditional Aggregation Functions
COUNTIF
=countif(A:A, "=apple")
SUMIF
Named Ranges
Creating named ranges is a lot more readable and easier to maintain.
How to create named ranges:
Formulas> Define Name
Vlookup: a function that uses a keyword and index to "look up" a value in a table
=VLOOKUP(A2,airline_lookup, 2, FALSE)
1) selecting a cell
2) selecting the range you are referring to -> here I used named ranges
3) Index of the column you are referring to
4) False -> exact match
True -> similar match
Subscribe to:
Posts (Atom)
SQL Joins
Database Normalization: Are the tables storing logical groupings of the data? Can I make changes in a single location, rather than in...
-
1. Search Engine Optimization is Important Only 5.6% of clicks reach beyond the first page of search results. The first top 3 keywords ...
-
I've started taking Digital Marketing Nanodegree at Udacity from Jan 2018. I'm going to write down what I've learned from the c...
-
Ad extensions: Enhance your Google Search Ads with additional, relevant information and give people reasons to check out your business. ...









