153|ALTERYX – COVID-19 Find and Replace

BYU Student Author: @Andrew_Wilson
Reviewers: @Sterling_Lane, @Marta_Ellsworth
Estimated Time to Solve: 30 Minutes

This is an intro challenge that is part of the Alteryx Learning Path.

We provide the solution to this challenge using:

  • Alteryx

Need a program? Click here.

Overview
At Simple Screenprinting we believe in quality work and accurate information. Your manager is preparing for a meeting to discuss the effects of COVID-19 on sales here at Simple Screenprinting; however, because the Orders table is part of a normalized database, it is hard to read without always referencing other tables. As you know, several of the columns (i.e. FreightID, SalesRepID, and JobTypeID) are presented foreign keys in other tables. Because of the upcoming meeting, your manager needs the information to be summarized and readable to other managers. It is extremely important that the data be stored in an Excel spreadsheet because your manager has never used Alteryx and thus cannot access an Alteryx file.

You will produce two separate reports, one for 2019 and one for 2020 outlining the number of each JobTypeID per Sales rep based upon how it was shipped out. You will use the Find and Replace, Transpose, Cross Tab and Output Data Tools to create readable reports for your manager’s upcoming meeting.

Your report should include the following information:

  1. Orders that were placed in 2020 based OrderDate
  2. Sales Rep Name
  3. Job Type name
  4. Count of each relevant shipping type, excluding delivery by Sales Reps (i.e. SHC – Deliver), in separate columns
  5. The Year (2020) in a separate column

Additionally, you should ensure your report is formatted using the following guidelines:

  • Orders should appear based on 1.) the Sales Rep from A-Z, 2.) Job Type from A-Z
  • Headers should appear as below

Instructions

  1. Download the challenge data and data dictionary below
  2. Familiarize yourself with the data and import the data into Alteryx using an Input tool (Orders table, Job Types Table, Employees Table, and Freight Table)
  3. Change relevant data types (JobTypeID, SalesRepID, FreightID) to allow use of the Find and Replace tool (See hint 1)
  4. Filter out any orders whose OrderDate is not in 2020
  5. Use the Find and Replace tool to change data in the orders table (See hint 2)
    • SalesRepID to Sales Rep Name
    • Job Type ID to Job Type Name
    • FreightID to Freight Name
  6. Use a Cross Tab tool to rearrange the data and count the quantity of orders based on Freight type. Make sure the JobTypeID and SalesRepID are selected in the Group By wizard. The column headers should be FreightID and the Value should be a count of the JT_Num (See Hint 3)
  7. Use the Append Tool to add the year (2020) to each line of data (See Hint 3)
  8. Select only the necessary rows
  9. Order by SalesRep and JobType
  10. Output the information to an Excel document using the Output tool. The sheet name should be the year (2020) you are analyzing
  11. Repeat the whole process for 2019 and compare the outputs. See if you can see any significant difference between the two years. You can compare more frequent shipping methods (i.e. Will_Call) to see if there is a significant difference in number of orders placed

Data Files

Suggestions and Hints
  1. The Find and Replace tool can only work with string data fields. You need to use a Select tool to change the data type before using a Find and Replace tool.
  2. Be careful that you connect smaller tables (JobTypes, Employees, Freight) to the Replace “R” side of the tool and the main table (Orders) to the Find “F” side of the tool. For more information, please refer back to the Alteryx Getting Started Module
  3. The Cross Tab tool is designed to use numeric data. Use a select tool to change the JT_Num to a Double.
  4. Use a Text Input tool to manually create the desired text input (2020)
  5. In the Output tool, under Output options select “Overwrite Sheet or Range” to prevent Alteryx from creating multiple files or sheets
  6. To repeat work you have already done, try copying and pasting

Solution

The Find and Replace tool is really powerful for extracting the right information from the tables, and I found that Alteryx ran a lot faster when I did those Find and Replaces instead of Joins like I initially wanted to. Also, thanks for the tip on the Copy and Paste! That saved me a lot of time doing the 2019 results.

2 Likes

This challege helped me realize that I am not using the Fine and Replace too nearly enough in Alteryx. Here is my 2020 querey, because my 2019 one is just a copy of this one.

1 Like

This was great practice to help me learn the Find & Replace!! Helps me do things so much faster and easier than using joins, feeling more like the utility of SQL. The Cross Tab thing was good practice for me as well. Love it!

2 Likes

Time to Complete: 15 minutes
Rating: Beginner
Find & Replace is such a powerful tool! Excited to use it more in the future!

This is my 2020 solution (2019 looks the same – just changed the text input & filter)

1 Like

This was a great practice of learning how to use the find and replace function and the cross tab function.
30 minutes!

1 Like

Great challenge! I found the Find & Replace tool to be very helpful. Here is my work for 2020 and 2019.

2 Likes

30 minutes
Intermediate

2 Likes

Time to Complete: 40 minutes
Difficulty: Intermediate

The workflow itself was not particularly difficult to follow but learning tools such as cross tab and find and replace were helpful and required extra time.

Time to Complete: 25 Min
Difficulty: Intermediate
Solution:

Time 15
Difficulty Intermediate

Time to complete 30 mins
Level: intermediate

1 Like

Time to complete 40 minutes
Difficulty: Intermediate

Here is my solution, took about 25 minutes. Great practice at find and replace and text input. Changed excel to browse cuz I didn’t want to save the solution file

2 Likes


Intermidate :1hr

Time to Complete: 30 mins

Time: 30 Minutes
Rating: Beginner
Comments: Fun challenge to see the power of find and replace!
Solution:

Time: 40
Level: Beginner
Great experience with find and replace!

Time to complete: 20 minutes
Difficulty: Medium