Sie sind auf Seite 1von 72

DESIGNER 101:

CORE CONCEPTS
Presented by
Wayne Wooldridge: Customer Support Supervisor
Peter Stoddard: Customer Support Sr. Engineer
# A LTERY X 1 8

AGE- • Designer Overview


– Navigating the Interface
• Reading Data

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

Prep and Blend Analyze Share

Enrich
Oracle

Oracle

# A LTERY X 1 8

SINGLE WORKFLOW FOR DATA


BLENDING , ANALYTICS, AND REPORTING
• A drag and drop visual workflow -
no programming required
• Seamless blending of data
• 60+ built-in tools for spatial and
R-based predictive analytics
• Simple creation of reports, data for
visualization, or analytics apps
• User productivity in hours not days

# A LTERY X 1 8

3
NAVIGATING THE
DESIGNER

# A LTERY X 1 8

TOP CALIFORNIA COUNTY PAY


I N S T RU C T I O N S R E S U LT S
Find the person who earned the
most (Total Pay and Benefits) in
2013 for each county.

FOLLOW ALONG # 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

VIEWING LOG MESSAGES IN


RESULTS
Messages - log of last for a given tool or workflow (click whitespace for
workflow messaging)
– Three level of messages
– Click the tool name to select the tool
– Click an input or output file name opens it with the native application

# 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

ALTERYX PARSES DATA TO TABLES


Field (Column)

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

READ SF STATE CONTROLLER DATA


I N S T RU C T I O N R E S U LT S
Add three Input Data tools (all the
same file):
1. Select the following sheet:
Controller_San_Francisco_City_D

2. Select the following Named Range:


SF_2014

3. Return a list of sheet names Input: Controller_San_Francisco_City_Data_All.xlsx

EXERCISE # A LTERY X 1 8

9
READING MULTIPLE
EXCEL SHEETS

# A LTERY X 1 8

CONFIGURING THE DYNAMIC INPUT

Drop a Dynamic Input tool after the Input Data


tool and set up an Input Template:
1. Click Edit:
– Select an Excel workbook
– Choose a sheet
2. Select the Read a List of Data Sources option
3. Set Field to Sheet Names

# A LTERY X 1 8

10
VISUALIZING DYNAMIC OUTPUT

# A LTERY X 1 8

VISUALIZING DYNAMIC OUTPUT

# A LTERY X 1 8

11
VISUALIZING DYNAMIC OUTPUT

# A LTERY X 1 8

READ IN MULTIPLE SHEETS


I N S T RU C T I O N S R E S U LT S
1. Input Tool: select List of Sheet
Names
2. Dynamic Input: dynamically input
each sheet from an Excel file
• Set up the template
• Select the first sheet
• Change the option to replace
table name
Input: Controller_San_Francisco_City_Data_Year.xlsx

EXERCISE # A LTERY X 1 8

12
READING DATA FROM
A CSV

# A LTERY X 1 8

CSV FILE SETTINGS


• Path to file
• File Format CSV
• Delimiters
– Use characters for comma (,), period (.),
and pipe (|)
– For none use backslash zero (\0)
– For tab use backslash (\t)
• Set the max field length for all fields,
default is 254
• Set Ignore behavior

# 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

– question mark (?) one character los-angeles-county-201?.csv matches


– los-angeles-county-2013.csv
– los-angeles-county-2012.csv
– los-angeles-county-2011.csv

# A LTERY X 1 8

READ SF AND LA 2013 PAY DATA


I N S T RU C T I O N S R E S U LT S
1. Combine both input files using a
single Input Data tool
2. Get 10 results for each
jurisdiction_name
3. Hint:

Input: San-Francisco-2013.csv, Los-Angeles-County-2013.csv

EXERCISE # A LTERY X 1 8

14
WRITING DATA

# A LTERY X 1 8

WHAT FILE TYPES CAN WE WRITE TO?


• Most of the input types, including: • Create a new file
– Alteryx DB • Overwrite an existing file
– Excel • Append to an existing file
– Tableau (hyper and .tde) • Create batch reports (write separate
– Qlik file/sheet/tables based on criteria)
• Additional output types: • Email results
– PDF
– Word
– Power Point
– More… # A LTERY X 1 8

15
WRITING DATA TO CSV

# A LTERY X 1 8

WRITING TO A SINGLE CSV

Hints for the next exercises:


Help  Sample Workflows  Clean and Prepare Data  Append a Leading Character

• Adding a character to the data


• Writing to multiple .csv files

FOLLOW ALONG # 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

ANSWER RESULT MESSAGES


Link to Input Data file

Link to Output Data file

# 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

VIEWING DATA TYPE


DETAILS

# 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

AUTO FIELD TOOL OVERVIEW


Automatically sets Types and Sizes
– Evaluates the content
– Sets based on values in the fields
– Only supports incoming string fields

# 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

• Why is the “Benefits” field a string? # A LTERY X 1 8

26
MANUALLY ADJUST
TYPES

# A LTERY X 1 8

USING THE SELECT TOOL TO


CHANGE TYPES AND SIZE
Type
– Forced on column
– Non-conforming values nulled
Size
– Numeric – in bytes
– String - length

# 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

ACCESS SF SALARY DATA


I N S T RU C T I O N S R E S U LT S
• Change the “Score” field to a
String data type (size 3)
• Write out the resulting data set to
an Excel file, one sheet per state

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

CREATING A CUSTOM FILTER

# 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)

Input File: shirts.csv


FOLLOW ALONG # A LTERY X 1 8

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

Input File: AddressData.yxdb

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

UNION SF DATA FROM 2011-2013


I N S T RU C T I O N S R E S U LT S
• Union the three streams
• Browse the results to confirm that
all three years are included in your
data stream

Input: san-francisco-2011.csv, san-francisco-2012.csv, san-francisco-2013.csv

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”

Input files: CA_Entities.yxdb, CA-Pension-Funding-Data.csv

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

Input: Customers.csv, Transactions.xml

EXERCISE # A LTERY X 1 8

ORANGE COUNTY RETIREMENT ENTITIES


I N S T RU C T I O N S R E S U LT S
• Join by Entity ID
• Remove the following fields from the
datastream:
• Fiscal Year End, Paper Report Due Date,
Electronic Report Due Date, Field Type,
Right Entity ID
• Filter your results to only include those from
Orange County
• Limit results to only 10 from each city
• Write to a single Excel Workbook, sheets
named based on the “System Type” field

Input: CA_Entities.yxdb, Retirement_Systems_Data.csv

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

AGE- • Formula Basics


– Formula tool (Functions, Variables)

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

BASIC FORMULA INTRO


• Output Fields
– Select ‘Add a Column’
– Select a name
• Tabs
– Variables
– Functions
– Saved Expressions
• Expression
• Data Preview

# 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

FUNCTIONS WITH PARAMETERS


Identify the target
Define the actions

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

CHANGE EMPLOYEE NAME TO


UPPER-CASE
I N S T RU C T I O N S R E S U LT S
• Use a formula to make the
employee_name field all upper-
case

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

IF [COLOR]= “blue” THEN 5.00

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

• Select the fields by name


• Use the plus operator “+” to add
the field together

# A LTERY X 1 8

SUBTRACTING DATA IN SAME ROW

• Select the field by name


• Use the minus operator “-” to
subtract and find the difference
• Even though we are subtracting
doubles make a field type of Int32 to
get a whole number, zero

# 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

Letter Position WELCOME TO CLASS


0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

# A LTERY X 1 8

UNDERSTANDING STRINGS AND


POSITION
• String Functions: Position
• GetWord([field],3) Result: “Alteryx”
Word Position 0 1 2 3
D a t a B l e n d i n g w i t h A l t e r y x

• FindString([field], “l”) Result: 6


Character Position 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
D a t a B l e n d i n g w i t h A l t e r y x

# A LTERY X 1 8

51
UNDERSTANDING STRING AND
LENGTH
Word Length WELCOME TO CLASS
1 2 3

Letter Length WELCOME TO CLASS


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

# A LTERY X 1 8

UNDERSTANDING STRINGS AND


LENGTH
• String Functions: Length
• Left([Field], 4) Result: “Data”
Character Position 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Character Length 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
D a t a B l e n d i n g w i t h A l t e r y x

• Right([Field], 2) Result: “yx”


Character Position 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Character Length 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
D a t a B l e n d i n g w i t h A l t e r y x

# 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

SHOW FIRST INITIAL AND LAST NAME


I N S T RU C T I O N S R E S U LT S
Using the previous exercise file update the
Employee Name field to contain only:
– The first letter in the field followed by
a period
– The last word in the field

Hint the word position is the number of


words in the field -1.
Input: san-francisco-2013.csv

EXERCISE # A LTERY X 1 8

54
ALTERYX DESIGNER
EXERCISES

# A LTERY X 1 8

SEPARATE COLOR AND NUMBER


I N S T RU C T I O N S R E S U LT S
From the image field, separate the
color and the number into new fields.

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

REMOVE CHARACTERS FROM


CURRENCY FIELD
I N S T RU C T I O N S R E S U LT S
From the Total Box Office field,
remove the following characters:
‘$’ and ‘,’

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

SELECTING THE TOP 10

# 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

AGGREGATING PAY DATA FOR


SF 2013

# 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

AGGREGATE PAY COLUMNS


I N S T RU C T I O N S R E S U LT S
• Create new fields that show the Connect to san-Francisco-2013.csv
sum of following fields:
– Base pay
– Overtime pay
– Total benefits
– Other pay
– Total pay
• Count the number of employees

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 Bob Dude 120 Count: Customers C 1


2
D 1
B Billy Bonk 30 1
B Bob Dude 20 2 Customer Sum Sales

B Bob Dude 50 3 Dan Duran 10


Group By: Customer Bob Dude 265
C Optimus Prime 60 1 Sum: Sales Billy Bonk 30
D Bob Dude 75 1 Optimus Prime 60

# 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

GROUP AND SUM BY SEGMENT


I N S T RU C T I O N S R E S U LT S
• Join by Customer ID
• Summarize the data by customer
segment and include a sum of sales
for each segment

Input files: customers.csv, transactions.xml

EXERCISE # A LTERY X 1 8

63
MULTI-FIELD
FORMULAS

# A LTERY X 1 8

VISUALIZING MULTI-FIELD FORMULAS

Task: Find numeric fields with [Nulls] and replace them with 0

Expression: IF ISNULL([_CurrentField_]) THEN 0 ELSE [_CurrentField_] ENDIF

Store Costs Revenue

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

PREPARING DATA FOR CALCULATIONS


– NULLS TO ZERO
• Insert a multi-field formula tool
• Select Numeric Fields
• Click All
• Write a conditional statement that
finds fields with null values and sets
them to zero
• Leave all other fields alone

# 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

USING THE MULTI-ROW


FORMULA TOOL
• Field selection (New or Modify)
• Number of rows available in expression
• Group by
• Variables
– Row-n: Field_Name Rows before the
current row
– Field_Name: Row the data is being created
in (current row)
– Row+n: Field_Name Row after the current
row

# 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

1 150 New York

2 650 San Mateo

3 230 Denver

Warehouse Inventory Qty Warehouse Location

900 Atlanta

150 Toledo

# A LTERY X 1 8

APPEND TOOL OVERVIEW


• Inserts the field(s) from each Source
record into every Target record
• Select Field options that allow you to:
– Rename fields
– Change the type, size, and position
– Include or drop fields
– Set the behavior if the field name
changes or new fields are added to
either data stream

# 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

• Get the top 10 counties based on


their Sum of Total Pay & Benefits

Input: 2013-counties.csv
EXERCISE # A LTERY X 1 8

HOW MANY CA ENTITIES


REPORTED FUNDING RATIOS?
I N S T RU C T I O N S R E S U LT S
• Create a new Year field with the
last 4 digits of the Fiscal Year field
• Calculate 3 numbers, each by year:
– Total number of entities reporting
any data
– Entities reporting Funded Ratio data
– Entities not reporting Funded Ratio
data
Input: CA-Pension-Funding-Data.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