INTRODUCTION TO JOINS IN TABLEAU



Similar documents
The join operation allows you to combine related rows of data found in two tables into a single result set.

Chapter 9 Joining Data from Multiple Tables. Oracle 10g: SQL

CPS352 Database Systems: Design Project

Converting Dimensions to Measures & Changing Data Types

Define terms Write single and multiple table SQL queries Write noncorrelated and correlated subqueries Define and use three types of joins

PSU SQL: Introduction. SQL: Introduction. Relational Databases. Activity 1 Examining Tables and Diagrams

Lab # 5. Retreiving Data from Multiple Tables. Eng. Alaa O Shama

Cashless Prepaid Card Systems Vending Systems for Prisons Biometrics Time & Attendance Kiosks Custom Technology Solutions

Understanding the Database Design Process

Clever + DreamBox SFTP Instructions

Using DATA Step MERGE and PROC SQL JOIN to Combine SAS Datasets Dalia C. Kahane, Westat, Rockville, MD

Solving the Rubik's Revenge (4x4x4) Home Pre-Solution Stuff Step 1 Step 2 Step 3 Solution Moves Lists

FERSOFT Software Project Management Plan Version 1.0 OBTRS ONLINE BUS TICKET RESERVATION SYSTEM

Advantage Web Services Overview

Exercise 1: Relational Model

ESS Personal Information Direct Deposit/Bank Information

Eclipse User Guide Candidate, Vacancy and Client Contact Matching. Candidate, Vacancy and Client Contact Matching

Common Application Supplement

Join Example. Join Example Cart Prod Comprehensive Consulting Solutions, Inc.All rights reserved.

MAKING PAYMENTS ONLINE. ELECTRONIC CHECKING (ACH) PAYMENTS PINLESS ATM DEBIT CARD PAYMENTS CREDIT CARD(only for Deposit Payments)

Answers to the Try It Yourself Sections

Credit Risk Migration Analysis Focused on Farm Business Characteristics and Business Cycles

1 Structured Query Language: Again. 2 Joining Tables

The 2010 British Informatics Olympiad

CIS 2010 Individual Database Assignment Detailed Instructions

Microsoft Excel 2007 Consolidate Data & Analyze with Pivot Table Windows XP

Question 1. Relational Data Model [17 marks] Question 2. SQL and Relational Algebra [31 marks]

Introduction to SQL C H A P T E R3. Exercises

Improving Retention and On-Time Graduation:

Gear Trains. Introduction:

Analyse von großen Datensätzen in den Lebenswissenschaften (192217)

COGNOS KARATE BELT SESSION III CREATING SLOTS

HOW TO CREATE A SECONDARY CLAIM

Examination of Four-Year Baccalaureate Completion Rates at Purdue University. April Enrollment Management Analysis and Reporting

Math 35 Section Spring Class meetings: 6 Saturdays 9:00AM-11:30AM (on the following dates: 2/22, 3/8, 3/29, 5/3, 5/24, 6/7)

How to access Administration Page for an End-of-Grade or End-of-Course Assessment

D B M G Data Base and Data Mining Group of Politecnico di Torino

Passion Parties PassionNet Order Payment Options

Recommended Full-Time MPH Course Sequence For Those Enrolled as Online Students starting in fall (or summer) Year 1 (22 credits) Fall 1 (10 credits)

7 Steps to Successful Data Blending for Excel

Blue Cross Blue Shield of Michigan and Blue Care Network

WEB-BASED STUDENT MANAGEMENT SYSTEM USING RFID

To access assessments, click the Assessments icon to be directed to the Find Assessments page.

Use Find & Replace Commands under Home tab to search and replace data.

New Participant Digital Certificate Enrollment Procedure

Aeries API Documentation (Application Programming Interface) September 9, 2015

EMPLOYEE MANUAL. ESS Document Version 1.0

SQL Access to OpenEdge Apps

QaTraq Pro Scripts Manual - Professional Test Scripts Module for QaTraq. QaTraq Pro Scripts. Professional Test Scripts Module for QaTraq

Step 1. Creating a new project

RN to BSN Interest Survey

Everything you need to know

How to Engage and Retain Customers

Graduate School Student Funding (GSSF) Web Application Manual

Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25)

Alaska Developmental Profile Web Site User s Guide

FEATURES. ! Sealing to IP68 (fully waterproof) Infra-red optical navigation technology

Database Development and Management with SQL

KR25i HIGH SPEED, HIGH CAPACITY REFRIGERATED CENTRIFUGE AUTO-LOCK. CQCS Traceability System VIDEOset Display!

Health Workforce Data Collection: Findings from a Survey of States

Microsoft Office 2010

A simple guide to using the HumaPen Luxura HD. If you need help with your Pen, call the. HumaPen Luxura HD Help Line:

Advanced Query for Query Developers

SmartBen Life Event Instructions

FINDING THE GOOD IN BAD DEBT BEST PRACTICES FOR TELECOM AND CABLE OPERATORS LAURENT BENSOUSSAN STEPHAN PICARD

Overview. Table of Contents. SA Data Warehouse

Delaware County Community College Course Equivalency Guide

Security threats and network. Software firewall. Hardware firewall. Firewalls

Get to Know Golf! John Dunigan

Titanium Schedule Client Import Guide

NEWH NURSING CONSORTIUM ASSOCIATE DEGREE NURSING (RN) ADMISSIONS PROCEDURE FOR FALL 2011 QUALIFICATION DEADLINE FEBRUARY 1, 2011

MacBook and OS X Basics

Transcription:

INTRODUCTION TO JOINS IN TABLEAU

Join Requirements 1. Join Type Determines which rows are selected Inner Left/Right Full 2. Join Clause Determines how rows from different tables are combined Variables from both tables that are the same

Join Types http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/ Inner Left (Right) Full Data has to be in BOTH tables Data has to be in LEFT (1 st ) table. Data in EITHER table. Right joins are just the opposite of Left joins, but more confusing they are not recommended. In other contexts, you may see Full, Left, and Right joins referred to as Outer joins. Thus, a Left Outer join is exactly the same as a Left join (same for Full and Right).

Join Clause Correct joins usually revolve around the Unique Row Key What combination of fields determines a UNIQUE row The variables that are the same in both tables Usually, variables have the same names, but this is not required Usually the Inner Join of the Unique Row Keys ID s are preferred over names when possible Examples (the unique row key for ENROLLMENT): STUDENT_ID ACADEMIC_YEAR ACADEMIC_TERM_ID CLASS_ID SECTION_ID

Toy Example Table A STUDENT_ID CLASS A UK 101 A MA 109 B UK 101 B CHE 105 B CIS 110 C WRD 110 Table B STUDENT_ID MAJOR A Business B Kinesiology D Nursing Join on STUDENT_ID Left Inner Full STUDENT_ID CLASS MAJOR A UK 101 Business A MA 109 Business B UK 101 Kinesiology B CHE 105 Kinesiology B CIS 110 Kinesiology C WRD 110 - STUDENT_ID CLASS MAJOR A UK 101 Business A MA 109 Business B UK 101 Kinesiology B CHE 105 Kinesiology B CIS 110 Kinesiology STUDENT_ID CLASS MAJOR A UK 101 Business A MA 109 Business B UK 101 Kinesiology B CHE 105 Kinesiology B CIS 110 Kinesiology C WRD 110 - D - Nursing

Toy Example 2 Keys Table A STUDENT_ID TERM CLASS A Fall UK 101 A Spring MA 109 B Fall UK 101 B Fall CHE 105 B Spring CIS 110 C Spring WRD 110 Table B STUDENT_ID TERM MAJOR A Fall Business A Spring Business B Fall Kinesiology B Spring Biology D Fall Nursing Left Join on STUDENT_ID and TERM STUDENT_ID TERM CLASS MAJOR A Fall UK 101 Business A Spring MA 109 Business B Fall UK 101 Kinesiology B Fall CHE 105 Kinesiology B Spring CIS 110 Biology C Spring WRD 110 - Left Join on STUDENT_ID only STUDENT_ID A.TERM CLASS B.TERM MAJOR A Fall UK 101 Fall Business A Fall UK 101 Spring Business A Spring MA 109 Fall Business A Spring MA 109 Spring Business B Fall UK 101 Fall Kinesiology B Fall UK 101 Spring Biology B Fall CHE 105 Fall Kinesiology B Fall CHE 105 Spring Biology B Spring CIS 110 Fall Kinesiology B Spring CIS 110 Spring Biology C Spring WRD 110 - -

Basic Rules of Thumb Start with table that most closely matches the population you need ENROLLMENT has one row for every class in which student is enrolled RETENTION includes some students NOT found in ENROLLMENT or other tables DEMOGRAPHICS includes an even larger set of students students Left join other tables onto this driver table Many of our STUDENT tables are designed so that the difference between Full/Left/Inner join is minimal E.g., Every student in STATS_PER_TERM is also in ENROLLMENT and vice versa

Unique Row Keys DEMOGRAPHICS STUDENT_ID STATS_PER_TERM STUDENT_ID, ACADEMIC_YEAR, ACADEMIC_TERM_ID, DEGREE_PROGRAM_TYPE ENROLLMENT STUDENT_ID, ACADEMIC_YEAR, ACADEMIC_TERM_ID, CLASS_ID, SECTION_ID RETENTION STUDENT_ID, ACADEMIC_YEAR, ACADEMIC_TERM_ID, COHORT_TYPE, (COHORT_GROUP) COURSE_DETAILS COURSE_ID, SECTION_ID, ACADEMIC_YEAR, ACADEMIC_TERM_ID

ENROLLMENT_STATS_PER_TERM_ DEMOGRAPHICS

MY_LISTS with RETENTION STUDENT_ID RETENTION_DATA NAME A List1 A List2 A List3 A List4 MY_LISTS.RESULT is the same as RETENTION.STUDENT_ID Returns the RETENTION data for each NAME-RESULT combo If a STUDENT_ID (RESULT) is in 4 lists (NAME), the RETENTION info will be joined to each of the 4 lists Here, a Left or Inner join should give you the same result Stick with Left for consistency. Works similarly with other tables (besides RETENTION)

BAD Examples Do NOT just use the Tableau default! RETENTION Left join to ENROLLMENT on STUDENT_ID Will return a row for every class student has taken for every term in RETENTION table Row multiplication! Put ACADEMIC_YEAR and ACADEMIC_TERM_ID in join clause! ENROLLMENT Left join to COURSE_DETAILS on ACADEMIC_YEAR, ACADEMIC_TERM, CLASS_ID SECTION_ID is also required, since classes have multiple sections in a term.