SlideShare a Scribd company logo
Tableau + Redshift views
for dummies
GOAL
Generate a new table with the desired data
No, no, no, no
We are not going to:
• Delete
• Insert
• Update
(for the moment…)
What we use
Redshift (PostgreSQL 8.0.2)
Tableau 8.1
Workbench / Navicat / Aginity workbench (for
previous exploration)
Selecting columns
Select A, C
FROM table;
A B C
1 ES 10
2 DE 20
3 ES 30
4 FR 40
3 ES 40
6 FR 60
A C
1 10
2 20
3 30
4 40
3 40
6 60
Selecting columns and rows
A B C
1 ES 10
2 DE 20
3 ES 30
4 FR 40
3 ES 40
6 FR 60
A C
1 10
3 30
3 40
Select A, C
WHERE B = ‘ES’
FROM table;
Transforming data
A B C
1 ES 10
2 DE 20
3 ES 30
4 FR 40
3 ES 40
6 FR 60
Select A, SUM(C) AS revenue
FROM table
GROUP BY A;
A revenue
1 10
2 20
3 70
4 40
6 60
Transforming data with operators
A B C
1 ES 10
2 DE 20
3 ES 30
4 FR 40
3 ES 40
6 FR 60
Select A, (C – C*.3) AS benefits
FROM table;
A benefits
1 7
2 14
3 21
4 28
6 28
6 42
Mathematical operators
Select A, (C – C*.3) AS benefits
FROM table;
Operator Description Example Result
+ addition 2 + 3 5
- subtraction 2 - 3 -1
* multiplication 2 * 3 6
/ division 4 / 2 2
% modulo 5 % 4 1
^ exponentiation 2.0 ^ 3.0 8
|/ square root | / 25.0 5
||/ cube root || / 27.0 3
@ absolute value @ -5.0 5
Math functions:
http://docs.aws.amazon.com/redshift/latest/dg/Math_functions.html
What seems to work better
1. Create a view in Redshift
2. Add the view to the table
3. Edit the Join if needed
4. Ready to go
Create a view in Redshift
CREATE OR REPLACE VIEW public.payingusers
SELECT
transactions.user_id, sum(transactions.amount_in_dollars)
AS revenue
FROM transactions
WHERE transactions.amount_in_dollars > 0::numeric(12,4)
GROUP BY transactions.user_id;
What seems to work better
1. Create a view in Redshift
2. Add the view to the table
3. Edit the Join if needed
4. Ready to go
Add the view to the table
• In Data select Edit Tables… and add the view
What seems to work better
1. Create a view in Redshift
2. Add the view to the table
3. Edit the Join if needed
4. Ready to go
Edit the Join if needed
• In Tables select Edit… and check the Join.
Ready to go
Links
• http://www.w3schools.com/sql/
• http://sqlzoo.net
• http://aws.amazon.com/es/documentation/redshift/
• http://www.postgresql.org/docs/8.0/interactive/index.html
• http://www.aginity.com/workbench/redshift/
• http://www.navicat.com/
Thanks !
Ivan Magrans
Product Owner
Golden Manager
@ivan_mv
ivan@mediavida.com

More Related Content

PPTX
Dashboard
PDF
Excel 2013 Chapter 3: SAM Project 1a Flex Cab Company FORMAT A REVENUE REPORT...
PPTX
SAP Lumira - Building visualizations
PPTX
SAP Lumira - Enriching data
PPTX
SAP Lumira - Acquiring data
PDF
Calc. Practice 2 (1º ESO)
DOCX
การเชื่อมต่อตารางและพิกัดแผนที่
PPT
Risk Analysis of Linear Projects
Dashboard
Excel 2013 Chapter 3: SAM Project 1a Flex Cab Company FORMAT A REVENUE REPORT...
SAP Lumira - Building visualizations
SAP Lumira - Enriching data
SAP Lumira - Acquiring data
Calc. Practice 2 (1º ESO)
การเชื่อมต่อตารางและพิกัดแผนที่
Risk Analysis of Linear Projects

What's hot (20)

PDF
Converting gis contours_to_cad
DOCX
DOC
SSRS BI Project
PPSX
Excel Waterfall Chart
PPT
Actuate BIRT - Graph
DOCX
How to create a report for Inside FT
PPT
Dervy bis-155-final-exam-guide-music-on-demand-new
PPTX
How to make Gantt chart in Excel
PPTX
MIS 226: Chapter 3
ODP
What's new in Calc and Chart
PDF
Excel 2016 | Module 3: SAM Project 1a Pick Up Motors
PPTX
Nspire--iPad App Tutorial--Scatterplots
PDF
Excel 2013 Chapter 8: SAM Project 1a Precision Guitars WORKING WITH PIVOTTABL...
PPT
Dynamic Web Pages Ch 8 V1.0
PDF
Sap arch
PDF
Streamlining Enterprise-Level GIS Reporting
PDF
Streamlining Enterprise-Level GIS Reporting
PDF
Spring 2020 excel project #1 instructions
PDF
Gantt excel
PDF
exploring_ecap_grader_c2_Transactions_LastFirst. solution
Converting gis contours_to_cad
SSRS BI Project
Excel Waterfall Chart
Actuate BIRT - Graph
How to create a report for Inside FT
Dervy bis-155-final-exam-guide-music-on-demand-new
How to make Gantt chart in Excel
MIS 226: Chapter 3
What's new in Calc and Chart
Excel 2016 | Module 3: SAM Project 1a Pick Up Motors
Nspire--iPad App Tutorial--Scatterplots
Excel 2013 Chapter 8: SAM Project 1a Precision Guitars WORKING WITH PIVOTTABL...
Dynamic Web Pages Ch 8 V1.0
Sap arch
Streamlining Enterprise-Level GIS Reporting
Streamlining Enterprise-Level GIS Reporting
Spring 2020 excel project #1 instructions
Gantt excel
exploring_ecap_grader_c2_Transactions_LastFirst. solution
Ad

Viewers also liked (6)

PPTX
Analyzing Billions of Data Rows with Alteryx, Amazon Redshift, and Tableau
PPTX
Tableau Software - Business Analytics and Data Visualization
PPT
Learning Tableau - Data, Graphs, Filters, Dashboards and Advanced features
PPTX
Tableau presentation
PPTX
Tableau Server Basics
PPTX
Tableau free tutorial
Analyzing Billions of Data Rows with Alteryx, Amazon Redshift, and Tableau
Tableau Software - Business Analytics and Data Visualization
Learning Tableau - Data, Graphs, Filters, Dashboards and Advanced features
Tableau presentation
Tableau Server Basics
Tableau free tutorial
Ad

Similar to Tableau + Redshift views for dummies (20)

PPT
PDF
Table partitioning in PostgreSQL + Rails
PPT
It ready dw_day4_rev00
PPTX
V.6 CSPro Tabulation Application_Creating Tables with PostCalc Application.pptx
PPT
Less08 Schema
DOCX
Tableau training course
PPTX
Session 8 connect your universal application with database .. builders & deve...
DOCX
SSRS - PPS - MOSS Profile
PPT
Les08 (manipulating data)
PPTX
Dax en
PPT
PPTX
Chris Seebacher Portfolio
PPT
DOCX
BI Step by Step
PPTX
Part3 Explain the Explain Plan
PPTX
Getting power bi
PPTX
Web Developer make the most out of your Database !
PDF
SQL Database Performance Tuning for Developers
PDF
MySQL Cheat Sheet & Quick Referenece.pdf
Table partitioning in PostgreSQL + Rails
It ready dw_day4_rev00
V.6 CSPro Tabulation Application_Creating Tables with PostCalc Application.pptx
Less08 Schema
Tableau training course
Session 8 connect your universal application with database .. builders & deve...
SSRS - PPS - MOSS Profile
Les08 (manipulating data)
Dax en
Chris Seebacher Portfolio
BI Step by Step
Part3 Explain the Explain Plan
Getting power bi
Web Developer make the most out of your Database !
SQL Database Performance Tuning for Developers
MySQL Cheat Sheet & Quick Referenece.pdf

Recently uploaded (20)

PPTX
Market Analysis -202507- Wind-Solar+Hybrid+Street+Lights+for+the+North+Amer...
PDF
Mega Projects Data Mega Projects Data
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PDF
Introduction to Data Science and Data Analysis
PDF
[EN] Industrial Machine Downtime Prediction
PPTX
Computer network topology notes for revision
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
STERILIZATION AND DISINFECTION-1.ppthhhbx
PPT
Reliability_Chapter_ presentation 1221.5784
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PPTX
SAP 2 completion done . PRESENTATION.pptx
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
Database Infoormation System (DBIS).pptx
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PDF
Introduction to the R Programming Language
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PPTX
1_Introduction to advance data techniques.pptx
Market Analysis -202507- Wind-Solar+Hybrid+Street+Lights+for+the+North+Amer...
Mega Projects Data Mega Projects Data
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
Acceptance and paychological effects of mandatory extra coach I classes.pptx
Introduction to Data Science and Data Analysis
[EN] Industrial Machine Downtime Prediction
Computer network topology notes for revision
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
STERILIZATION AND DISINFECTION-1.ppthhhbx
Reliability_Chapter_ presentation 1221.5784
Qualitative Qantitative and Mixed Methods.pptx
SAP 2 completion done . PRESENTATION.pptx
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Database Infoormation System (DBIS).pptx
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
Introduction to the R Programming Language
Introduction-to-Cloud-ComputingFinal.pptx
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
1_Introduction to advance data techniques.pptx

Tableau + Redshift views for dummies

  • 1. Tableau + Redshift views for dummies
  • 2. GOAL Generate a new table with the desired data
  • 3. No, no, no, no We are not going to: • Delete • Insert • Update (for the moment…)
  • 4. What we use Redshift (PostgreSQL 8.0.2) Tableau 8.1 Workbench / Navicat / Aginity workbench (for previous exploration)
  • 5. Selecting columns Select A, C FROM table; A B C 1 ES 10 2 DE 20 3 ES 30 4 FR 40 3 ES 40 6 FR 60 A C 1 10 2 20 3 30 4 40 3 40 6 60
  • 6. Selecting columns and rows A B C 1 ES 10 2 DE 20 3 ES 30 4 FR 40 3 ES 40 6 FR 60 A C 1 10 3 30 3 40 Select A, C WHERE B = ‘ES’ FROM table;
  • 7. Transforming data A B C 1 ES 10 2 DE 20 3 ES 30 4 FR 40 3 ES 40 6 FR 60 Select A, SUM(C) AS revenue FROM table GROUP BY A; A revenue 1 10 2 20 3 70 4 40 6 60
  • 8. Transforming data with operators A B C 1 ES 10 2 DE 20 3 ES 30 4 FR 40 3 ES 40 6 FR 60 Select A, (C – C*.3) AS benefits FROM table; A benefits 1 7 2 14 3 21 4 28 6 28 6 42
  • 9. Mathematical operators Select A, (C – C*.3) AS benefits FROM table; Operator Description Example Result + addition 2 + 3 5 - subtraction 2 - 3 -1 * multiplication 2 * 3 6 / division 4 / 2 2 % modulo 5 % 4 1 ^ exponentiation 2.0 ^ 3.0 8 |/ square root | / 25.0 5 ||/ cube root || / 27.0 3 @ absolute value @ -5.0 5 Math functions: http://docs.aws.amazon.com/redshift/latest/dg/Math_functions.html
  • 10. What seems to work better 1. Create a view in Redshift 2. Add the view to the table 3. Edit the Join if needed 4. Ready to go
  • 11. Create a view in Redshift CREATE OR REPLACE VIEW public.payingusers SELECT transactions.user_id, sum(transactions.amount_in_dollars) AS revenue FROM transactions WHERE transactions.amount_in_dollars > 0::numeric(12,4) GROUP BY transactions.user_id;
  • 12. What seems to work better 1. Create a view in Redshift 2. Add the view to the table 3. Edit the Join if needed 4. Ready to go
  • 13. Add the view to the table • In Data select Edit Tables… and add the view
  • 14. What seems to work better 1. Create a view in Redshift 2. Add the view to the table 3. Edit the Join if needed 4. Ready to go
  • 15. Edit the Join if needed • In Tables select Edit… and check the Join.
  • 17. Links • http://www.w3schools.com/sql/ • http://sqlzoo.net • http://aws.amazon.com/es/documentation/redshift/ • http://www.postgresql.org/docs/8.0/interactive/index.html • http://www.aginity.com/workbench/redshift/ • http://www.navicat.com/
  • 18. Thanks ! Ivan Magrans Product Owner Golden Manager @ivan_mv ivan@mediavida.com