Professional Documents
Culture Documents
CORE CONCEPTS
Presented by
Wayne Wooldridge: Customer Support Supervisor
Peter Stoddard: Customer Support Sr. Engineer
# A LTERY X 1 8
NDA
– Input Data tool
– Sample tool
• Writing Data
– Output Data tool
• Data Types
– Auto Field tool
– Select tool
• Additional Exercises
# A LTERY X 1 8
1
INTRODUCTIONS
Denise Frey: Enterprise Team Lead
Katie Anderson: QA Automation Team Lead
Ashley Hellwege: Technical Program Manager
Ben Burkholder: Customer Success Manager
# A LTERY X 1 8
ALTERYX OVERVIEW
# A LTERY X 1 8
2
WHAT IS ALTERYX
Input Output
Alteryx Platform
SAS DESIGNER SERVER GALLERY
Enrich
Oracle
Oracle
# A LTERY X 1 8
# A LTERY X 1 8
3
NAVIGATING THE
DESIGNER
# A LTERY X 1 8
4
COMPONENTS OF A WORKFLOW
• Tool – step in the process
• Anchors – input and/or output of a tool
• Connections– controls the flow of data from one tool to the next
# A LTERY X 1 8
# A LTERY X 1 8
5
VIEWING DATA IN A WORKFLOW
Input (Data coming into tool) Output (Data coming out of tool)
# A LTERY X 1 8
READING DATA
# A LTERY X 1 8
6
WHERE CAN ALTERYX READ
DATA FROM?
• Local and networked files
• Databases
• Web services
• Spatial files
# A LTERY X 1 8
Record (Row)
# A LTERY X 1 8
7
HOW TO CONNECT TO A FILE
Local
– Path to file (absolute or relative)
– File must be unlocked
Network
– Log into network
– URI or Mapped Drive
# A LTERY X 1 8
READING DATA IN
EXCEL
# A LTERY X 1 8
8
READING IN EXCEL DATA
Tables:
– Sheets
– Named ranges
– List of sheet names
# A LTERY X 1 8
EXERCISE # A LTERY X 1 8
9
READING MULTIPLE
EXCEL SHEETS
# A LTERY X 1 8
# A LTERY X 1 8
10
VISUALIZING DYNAMIC OUTPUT
# A LTERY X 1 8
# A LTERY X 1 8
11
VISUALIZING DYNAMIC OUTPUT
# A LTERY X 1 8
EXERCISE # A LTERY X 1 8
12
READING DATA FROM
A CSV
# A LTERY X 1 8
# A LTERY X 1 8
13
READING MULTIPLE FILES
Use wildcards modify the PATH field:
san-francisco-*.csv matches
– asterisk (*) zero or more characters
– san-francisco-2013.csv
– san-francisco-2012.csv
– san-francisco-2011.csv
# A LTERY X 1 8
EXERCISE # A LTERY X 1 8
14
WRITING DATA
# A LTERY X 1 8
15
WRITING DATA TO CSV
# A LTERY X 1 8
16
WRITING TO A SINGLE CSV
I N S T RU C T I O N S R E S U LT S
• Add an Output tool and read: • File: RI_MA_ZIPS.CSV
CSVGeocode_example.csv
• Make sure ZIP codes have 5 digits
• Choose file name/location to save
as: RI_MA_ZIPS.csv
• Use commas as delimiters
• First row contains column (field)
names
• Run the workflow
EXERCISE # A LTERY X 1 8
# A LTERY X 1 8
17
WRITING TO MULTIPLE FILES
I N S T RU C T I O N S R E S U LT S
• Add an Output tool and read: Two files:
CSVGeocode_example.csv
• RI-ZIPS.csv
• Choose file name/location to save as CSV
• MA-ZIPS.csv
• Use commas as delimiters
• First row contains column (field) names
• Edit path and give file name “-ZIPS”
• Prepend the state prefix to the file using
the take file name from field option
EXERCISE # A LTERY X 1 8
WRITING DATA TO
EXCEL
# A LTERY X 1 8
18
WRITING TO MULTIPLE EXCEL SHEETS
I N S T RU C T I O N S R E S U LT S
• Modify Output Data tool • File
• Choose file name/location to save – ZIPS.xlsx
as ZIPS.xlsx • Sheets
• Edit path and give sheet name – RI
“Sheet1” – MA
• Replace table name with the State
Help > Sample Workflows > Clean and Prepare Data > Append a Leading Character
EXERCISE # A LTERY X 1 8
UNDERSTANDING
DATA TYPES
# A LTERY X 1 8
19
WHAT IS A DATATYPE?
• Strings
• Numbers
• Dates and Time
• Boolean (0 or 1; True or False)
• Spatial objects
# A LTERY X 1 8
WHAT IS A DATATYPE?
• String
– String
– WString
– V_String
– V_WString
# A LTERY X 1 8
20
WHAT IS A DATATYPE?
• String
• Number
– Byte
– Int16
– Int32
– Int64
– Fixed Decimal
– Float
– Double
# A LTERY X 1 8
WHAT IS A DATATYPE?
• String
• Number
• Date
– Date
yyyy-mm-dd
– DateTime
yyyy-mm-dd hh:mm:ss
– Time
hh:mm:ss
# A LTERY X 1 8
21
WHAT IS A DATATYPE?
• String
• Number
• Date
• Boolean
– 0 – False
– 1 – True
# A LTERY X 1 8
WHAT IS A DATATYPE?
• String
• Number
• Date
• Boolean
• Spatial Objects
# A LTERY X 1 8
22
HOW ALTERYX SETS TYPES
Databases
– Mapped to data type and size
Files
– Uses information from the file when possible
– Evaluates for Excel and dBase
– Sets fields from CSV, JSON, XML, etc, to String
# A LTERY X 1 8
# A LTERY X 1 8
23
CONFIGURATION - INCOMING
FIELD INFORMATION
Input Properties:
– Name
– Type
– Size
– Source
# A LTERY X 1 8
CONFIGURATION - INCOMING
FIELD INFORMATION
Output Properties:
– Name
– Type
– Size
– Source
# A LTERY X 1 8
24
AUTOMAGICALLY
CHANGE TYPES
# A LTERY X 1 8
# A LTERY X 1 8
25
AUTOMATICALLY SET DATA TYPES
I N S T RU C T I O N S R E S U LT S
• Automatically adjust the
field types
• Run the workflow
• Review the results
Input: san-francisco-2013.csv
EXERCISE # A LTERY X 1 8
ANSWER: DISCUSSION
BEFORE AFTER
26
MANUALLY ADJUST
TYPES
# A LTERY X 1 8
# A LTERY X 1 8
27
MANUALLY SET DATA TYPES
I N S T RU C T I O N S R E S U LT S
• Modify the previous workflow in
the following ways:
• Change input to San-
Francisco-2011.csv
• Run the workflow
• Use the select tool to change the
field back to a Double
Change input to San-Francisco-2011.csv
EXERCISE # A LTERY X 1 8
ADDITIONAL
EXERCISES
# A LTERY X 1 8
28
ACCESS SF SALARY DATA
I N S T RU C T I O N S R E S U LT S
• With a single Input Data tool, read
in all three San Francisco salary
files (2011,2012,2013)
• Limit your data set to only 10
records per year
• Output your data set to a single
CSV file called SF_salaries.csv
Input: san-franciso-2011.csv, san-franciso-2012.csv, san-franciso-2013.csv
EXERCISE # A LTERY X 1 8
Input: AddressData.yxdb
EXERCISE # A LTERY X 1 8
29
SET DATA TYPES, WRITE TO
SEVERAL CSV FILES BY GROUP
I N S T RU C T I O N S R E S U LT S
• Set data types
– Zip as String size 5
– Zip4 as String size 4
– Group as Int16
• Drop 3 fields
– Stcode
– Cntycd
– Sequence
• Write to multiple CSV files, named based on
the value in the Group field Input: CSVGeocode_example.csv
EXERCISE # A LTERY X 1 8
DESIGNER 101
PART 2
# A LTERY X 1 8
30
AGE- • Conditional Expressions
– Filter tool
NDA
• Data Blending
– Union tool
– Join tool
• Additional Exercises
# A LTERY X 1 8
CONDITIONAL
EXPRESSIONS
# A LTERY X 1 8
31
FILTER TOOL
Basic Filter
– Tests for a single condition
– Writes the Expression for you
Custom Filter
– Check for more complex conditions
– Check for multiple conditions
# A LTERY X 1 8
# A LTERY X 1 8
32
CREATING A CUSTOM FILTER
# A LTERY X 1 8
COMPOUND
EXPRESSIONS
# A LTERY X 1 8
33
OR STATEMENT
True
[COLOR]=“BLUE” FALSE
TRUE
OR
False
[COLOR]=“YELLOW” FALSE
TRUE
# A LTERY X 1 8
AND STATEMENT
True
[NUMBER]>=2 FALSE
TRUE
AND
[NUMBER]<=5
TRUE
FALSE False
# A LTERY X 1 8
34
FILTERING SHIRT DATA
I N S T RU C T I O N S R E S U LT S
Create separate (parallel) filters for each
of the following:
1. Yellow shirts greater than 5
2. All green shirts and any shirt greater
than 4
3. Yellow shirts between 3 and 6
4. All orange shirts and yellow shirts
5. Shirts with even numbers (1 filter
tool, hint math function)
COMPOUND FILTER
I N S T RU C T I O N R E S U LT S
Create a filter to find:
– Records for city of AGAWAM and
BELCHERTOWN
– With scores between 25 and 50
EXERCISE # A LTERY X 1 8
35
DATA BLENDING -
UNION
# A LTERY X 1 8
VISUALIZING UNIONS
2011 Customers
ID Name Manually Configured Automatically Configured
12 Joe Schmoe
35 John Dear
67 Jane Doe
Automatic
Manual Configuration
Configuration
87 Ricky Martin
2012 Customers
ID Full Name
3 Ricky Bobby
42 Keyser Soze
49 Willy Wonka
87 Ricky Martin
# A LTERY X 1 8
36
UNION TOOL OVERVIEW
• Configurations
– Auto Configuration
– Configuration by position
– Manual Configuration
• Same data type
• First row of manual configuration
determines field name
# A LTERY X 1 8
EXERCISE # A LTERY X 1 8
37
JOINING DATA
# A LTERY X 1 8
VISUALIZING JOINS
Left Input
ID First
12 John
33 Tim
36 Jane
Join Output
Right Input
ID
Right_ID Last ID=ID
2 Smith
12 Dear
36 Doe
# A LTERY X 1 8
38
SAMPLE JOIN WORKFLOW
# A LTERY X 1 8
JOIN INTRO
• Match by Position or Keys
• Key fields
– Same data type on both sides of Join
– Values must match exactly
• “Select” behavior applied to J output
only
# A LTERY X 1 8
39
RETIREMENT ENTITIES IN SF
I N S T RU C T I O N S R E S U LT S
• Blend data together on “Entity ID”
• Limit results to entities in “SF
County”
EXERCISE # A LTERY X 1 8
ADDITIONAL
EXERCISES
# A LTERY X 1 8
40
FIND DENVER CONSUMER CUSTOMERS
I N S T RU C T I O N S R E S U LT S
• Join by Customer ID
• Include only records for Consumer
customer segment
• City of Denver
• Have responded to previous
marketing
EXERCISE # A LTERY X 1 8
EXERCISE # A LTERY X 1 8
41
CALIFORNIA SALARIES GREATER THAN $200K
I N S T RU C T I O N S R E S U LT S
• Union the two inputs together,
outputting only fields included in both
sources
• Change “Total Pay & Benefits” to a
Double field type
• Keep only results for employees
earning more than $200,000 (Total
Pay & Benefits)
• Write out the first 500 results to a
CSV file
Input: 2011-counties.csv, 2013-counties.csv
EXERCISE # A LTERY X 1 8
LUNCH BREAK
# A LTERY X 1 8
42
DESIGNER 101:
PART III
# A LTERY X 1 8
NDA
– Conditional Expressions
• Introduction to Calculations
• String Expressions
– Characters
– Words
• Additional Exercises
# A LTERY X 1 8
43
FORMULA BASICS
# A LTERY X 1 8
# A LTERY X 1 8
44
SELECTING AND CREATING FIELDS
• Output Field
– Dropdown Existing Field
– Select ‘Add Column’ for new field
– Type (new only)
– Size (new only)
• Expressions – the ‘formula’ applied
to the field
# A LTERY X 1 8
Examples:
– Change the value to all uppercase:
UPPERCASE([Name])
– Add 30 seconds:
DateTimeAdd([Time],30,”secs”)
# A LTERY X 1 8
45
SYNTAX HINTING AND VALIDATION
# A LTERY X 1 8
Input: san-francisco-2013.csv
EXERCISE # A LTERY X 1 8
46
CONDITIONAL
EXPRESSIONS
# A LTERY X 1 8
USING CONDITIONAL
EXPRESSIONS IN FORMULAS
Example: Using the shirts table insert a price field. Blue
shirts are $5.00 and all other shirts are $2.50
ELSE 2.50
ENDIF
IF c THEN t
// c – conditional statement
// t – action for true
ELSE f
// f – action for everything not true
ENDIF
# A LTERY X 1 8
47
CONDITIONAL SHIRT PRICING
I N S T RU C T I O N S R E S U LT S
Add a price field to the shirts dataset
where:
– Blue shirts are $5.00
– Yellow shirts are $1.50
– All other shirts are $9.99
Input: shirts.csv
EXERCISE # A LTERY X 1 8
INTRODUCTION TO
CALCULATIONS
# A LTERY X 1 8
48
ADDING DATA IN SAME ROW
# A LTERY X 1 8
# A LTERY X 1 8
49
VALIDATE PAY FIELDS
I N S T RU C T I O N S R E S U LT S
• Set field types
• Create a field called "sum_pay"
that adds the following fields:
– Base_pay, overtime_pay, other_pay,
total_benefits
• Create a second field called Diff
that finds Total Pay and Benefits
minus the sum_pay field
Input: san-francisco-2013.csv
EXERCISE # A LTERY X 1 8
STRING EXPRESSIONS
# A LTERY X 1 8
50
UNDERSTANDING STRINGS AND
POSITION
Word Position WELCOME TO CLASS
0 1 2
# A LTERY X 1 8
# A LTERY X 1 8
51
UNDERSTANDING STRING AND
LENGTH
Word Length WELCOME TO CLASS
1 2 3
# A LTERY X 1 8
# A LTERY X 1 8
52
GET FIRST INITIAL
I N S T RU C T I O N S R E S U LT S
• Get the first 10 employees
• Create a field that has the first letter
in the employee name field follow
by a period and space
Input: san-francisco-2013.csv
EXERCISE # A LTERY X 1 8
WORKING WITH
WORDS
# A LTERY X 1 8
53
WRITING FORMULAS THAT GET
WORDS
What is a word?
– Group of letters and/or numbers that
may include a hyphen (-)
– Separated by a period, a colon or semi-
colon, or any other symbol except
hyphen
How many words in a field?
Words by position (where zero is the first
word)
# A LTERY X 1 8
EXERCISE # A LTERY X 1 8
54
ALTERYX DESIGNER
EXERCISES
# A LTERY X 1 8
Input: Shirt-Data.yxdb
EXERCISE # A LTERY X 1 8
55
CREATE A SHIRT DESCRIPTION
I N S T RU C T I O N S R E S U LT S
Libby’s T-Shirt Emporium needs to sends
description text for each of the shirts to
the new Web Site vender.
Create a description field for each record
where the color and number is
automatically inserted in the marketing
directors blurb.
Input: Shirts.csv
– “High quality organic cotton Blue T-
shirt with the number 1 emblem.”
EXERCISE # A LTERY X 1 8
Input: top10inflationadjusted.csv
EXERCISE # A LTERY X 1 8
56
AFTERNOON BREAK
# A LTERY X 1 8
DESIGNER 101:
PART IV
# A LTERY X 1 8
57
AGE- • Top 10 lists
– Sort and Sample Tools
NDA
• Aggregating Data From Multiple Rows
– Summarize tool
• Applying Formulas to Multiple Fields
– Multi-Field Formula tool
• Calculating with Several Rows
– Multi-Row Formula
• Appending Data to Another Data Set
– Append Tool
• Additional Exercises
# A LTERY X 1 8
# A LTERY X 1 8
58
SORT AND SAMPLE TOOLS
# A LTERY X 1 8
10 SALARIES BY COUNTY
I N S T RU C T I O N S R E S U LT S
• Rename the Agency field as county
• Get the top 10 records for each
county in descending order by the
Total Pay & Benefits field
Input: 2013-counties.csv
EXERCISE # A LTERY X 1 8
59
INTRODUCTION TO
AGGREGATION
# A LTERY X 1 8
# A LTERY X 1 8
60
BASIC INTRO TO SUMMARIZE
• Select Field by highlighting
• Add > ACTION (applied to
column)
– Data Type dependent actions
greyed out if selected field is not
the matching data type
• You can rename the Output Field
Name
# A LTERY X 1 8
EXERCISE # A LTERY X 1 8
61
SUMMARIZE FOR EACH
• Select Field by highlighting
• Add > Group by
– Grouping separates the fields into
buckets based on the field values
– Actions (Sum, Count, etc) is then
applied to group
• You can rename the output field
# A LTERY X 1 8
VISUALIZING SUMMARIZATIONS
Store Count Customers
Store Customer Sales
A 2
A Dan Duran 10 1 Group By: Store B 3
# A LTERY X 1 8
62
AGGREGATE PAY COLUMNS
I N S T RU C T I O N S R E S U LT S
• Set the Field Data Types
• Aggregate Pay by County:
– Group on Agency
– Sum fields:
• Base pay
• Overtime pay
• Total benefits
• Other pay
• Total pay
Input: 2013-counties.csv
EXERCISE # A LTERY X 1 8
EXERCISE # A LTERY X 1 8
63
MULTI-FIELD
FORMULAS
# A LTERY X 1 8
Task: Find numeric fields with [Nulls] and replace them with 0
A [Null]
0 Current [Null]
0
Field
B 259 350
C [Null]
0 312
# A LTERY X 1 8
64
APPLYING THE SAME FORMULA
TO MULTIPLE FIELDS
• Making changes across a data set:
– Select fields by Type
– Select by Name
– Unknown Fields (apply/not)
• Change each field or create new fields
• Change the data type
• Write the expression using a special
variable [_CurrentField_]
# A LTERY X 1 8
# A LTERY X 1 8
65
CLEANSING NULL VALUES
I N S T RU C T I O N S R E S U LT S
• Insert a Multi-field formula tool
that replaces nulls with zeros
• Rerun the workflow and check the
results
Input: San-Francisco-2013.csv
EXERCISE # A LTERY X 1 8
CALCULATING WITH
SEVERAL ROWS
# A LTERY X 1 8
66
VISUALIZING MULTI-ROW FORMULAS
Goal: Rank stores for each month using multi-formula tool
Group by: Month
Values that Don’t Exist: 0
Logic: [Row-1:Store_Rank]+1
Store_Name Month Sales Store_Rank
Row-1 A November [0]
600 [Row-1:Store_Rank]+1 0+1 1
Active Row B November 387 1 [Row-1:Store_Rank]+1 1+1 2
Row+1 C November 562 2 [Row-1:Store_Rank]+1 2+1 3
A December 497 3
B December [0]
503 [Row-1:Store_Rank]+1 0+1 1
1 [Row-1:Store_Rank]+1 1+1 2
2
[0]
# A LTERY X 1 8
# A LTERY X 1 8
67
COMPUTE CHANGE IN SALES
MONTH OVER MONTH R E S U LT S
I N S T RU C T I O N S
Add a field that shows the difference
in sales for each month from the
previous month (for each store).
Input: MonthlySales.csv
EXERCISE # A LTERY X 1 8
APPENDING DATA
# A LTERY X 1 8
68
VISUALIZING DATA APPENDS
Store ID Supply Request Qty Location
3 230 Denver
900 Atlanta
150 Toledo
# A LTERY X 1 8
# A LTERY X 1 8
69
PERCENT OF TOTAL SALES FOR
EACH SEGMENT
I N S T RU C T I O N S R E S U LT S
• Join the customers and transactions
datasets
• Calculate Sales by Segment
• Calculate Total Sales
• Use the append tool to bring the
two datasets back together into one
Inputs: Transactions.xml, Customers.csv
• Calculate the percent of sales for
each segment
EXERCISE # A LTERY X 1 8
ALTERYX DESIGNER
EXERCISES
# A LTERY X 1 8
70
TOP 10 COUNTIES BY SUM OF
TOTAL PAY & BENEFITS
I N S T RU C T I O N S R E S U LT S
• By County Agency
• Sum of Total Pay and Benefits
• Count of unique employees
Input: 2013-counties.csv
EXERCISE # A LTERY X 1 8
71
WHICH 10 COUNTIES HAD THE
MOST PENSION ENTITIES?
I N S T RU C T I O N S R E S U LT S
• After joining your two inputs
together, find how many unique
“entities” exist for each county
• List the 10 counties that have the
highest number of entities
• Ignore entries for the “NULL”
county
Input: CA_Entities.yxdb, CA-Pension-Funding-Data.csv
EXERCISE # A LTERY X 1 8
THANK wwooldrige@alteryx.com
pstoddard@alteryx.com
Please complete a
feedback survey!
YOU
Wayne Wooldridge
Peter Stoddard
Denise Frey
Katie Anderson
Ashley Hellwege
Ben Burkholder # A LTERY X 1 8
72