Prepare a product-sales report that a manager can read without opening Alteryx. Build a chart, a formatted table and an evidence-based conclusion. Export the result as a PDF.
Summarize, Formula, Sort, Join and Browse prepare and connect the report pieces.
Before you start
Extract the student ZIP into a new folder.
Open 8.5_Report_Start.yxmd.
Run it and inspect Browse. Keep the data folder beside the workflow.
Use Alteryx Designer with the Reporting tools available. The lesson uses the coffee-and-tea observations from 8.3; no earlier module files are required.
Screenshots · Step 1
Data processing
2 · Inspect the source
Inspect the source
Input DataSelectBrowse
Input Data reads the CSV into the workflow. Select controls which fields pass through and their data types. Browse lets you inspect the records and field profiles before calculating totals.
Open the starter workflow and select Input Data. Confirm that it reads data/Sales.csv.
Select the Select tool. Inspect the field names and types; Sales and Profit need a numeric type so they can be summed. Double stores numeric values with decimal places.
Run the workflow and open Browse. Inspect the dates and products to establish the report’s scope.
What does one row represent, and what period will your report cover?
Configuration
Inspect RowID, Month, Product, Sales and Profit. Sales and Profit must be Double. Identify the observed months for the report scope.
Check your result
942 observations; October–December 2012 and October–December 2013. Use all products in the report.
If the embedded page is unavailable, use the direct link above.
Data processing
3 · Summarize and calculate margin
Prepare the report data
SummarizeFormula
Summarize combines observations into product totals. Group By creates a separate group for each product; Sum adds the numeric values within that group. Formula then calculates a new value for each summarized product.
Connect Summarize after Select. Configure the grouping and totals below.
Connect Formula after Summarize to calculate profit margin from those totals.
Attach Browse to Formula, run the workflow, and check the numeric summary.
Add a Summarize tool to calculate total sales and total profit for each product. How would you configure it? Which field would you group by, and which aggregation would you apply to Sales and Profit?
Configuration
Field
Action
Output name
Product
Group By
Product
Sales
Sum
TotalSales
Profit
Sum
TotalProfit
Calculate profit margin
Attach a Formula tool after Summarize. How would you configure it to calculate MarginPct for each product? Decide the output field name, data type and expression.
Hint · margin calculation
Use total profit divided by total sales, multiplied by 100. Consider what the expression should return if total sales is zero.
Reveal Formula settings
Setting
Value
Output field
MarginPct
Data type
Double
Meaning
Total profit as a percentage of total sales
Enter this expression. A zero sales total returns Null because the ratio is undefined:
IF [TotalSales] = 0 THEN Null()
ELSE Round(100.0 * [TotalProfit] / [TotalSales], 0.01)
ENDIF
Attach Browse to Formula and run the workflow to inspect the results.
Check your result
12 product rows. TotalSales sums to 172,134; TotalProfit sums to 51,379. Calculate margin from total profit and total sales. This weights the result by sales; adding or averaging row percentages can produce a different result.
If the embedded page is unavailable, use the direct link above.
Reporting workflow
4 · Sort and build the chart
Choose a useful chart
SortInteractive Chart
Sort orders records before they reach the reporting tools. Use the sales ranking to help the reader identify the largest products quickly.
Attach Sort to Formula and choose the primary sort field and direction.
Add Product as the secondary field, ascending, to break ties alphabetically.
Connect Interactive Chart to Sort. Run the workflow before opening Configure Chart.
Add a Sort tool after Formula. To show sales from the highest amount to the lowest, which field and sort direction would you use? Add Product as the second sort field in ascending order so products with the same sales amount appear alphabetically.
Meet the Interactive Chart tool
Interactive Chart turns your data into a visual. Connect it to the Sort output, run the workflow, then select Configure Chart.
Chart type: Bar compares categories; Line shows changes over time; Scatter compares two numeric measures; Pie shows parts of a total.
Layer: A set of plotted values. Start with one layer for product sales.
Data: Choose the fields used for the X and Y axes.
Style: Adjust the title, axis labels, colors, legend and chart size.
For this report, create a bar chart of total sales by product. Which field belongs on each axis?
Configuration
Priority
Field
Order
1
TotalSales
Descending
2
Product
Ascending
Use TotalSales as the first sort field. Descending puts the highest amounts first. Use Product ascending as the second field; this orders product names within equal sales amounts.
Add a Bar layer. Use Product for X and TotalSales for Y (vertical bars). Keep these already summarized values. Set a zero baseline, readable product labels and the title “Sales by product — observed periods”. Label sales as source units. A horizontal bar chart is also acceptable.
Check your result
12 bars; Lemon has the highest sales, 24,048. Bar charts make it easier to compare products.
Screenshots · Step 4
Alteryx resource · Sort
If the embedded page is unavailable, use the direct link above.
Alteryx resource · Interactive Chart
If the embedded page is unavailable, use the direct link above.
Reporting workflow
5 · Add Basic Table and Browse
Add a numeric table
Basic TableBrowse
Basic Table formats the numeric summary as a report element. The totals and margin come from Summarize and Formula; Basic Table controls the columns, headings, and appearance.
Connect Sort to Basic Table, creating a second branch beside Interactive Chart.
Choose the columns and formatting for the product summary.
Attach Browse directly to Basic Table, run the workflow, and inspect the formatted result.
Add Basic Table and connect a Browse tool to its output. We want a simple descriptive statistics table showing total sales, total profit and MarginPct for each product. How would you configure Basic Table?
Configuration
Setting
Configuration
Table mode
Basic
Columns
Product, TotalSales, TotalProfit, MarginPct
Group By
None
Margin heading
Margin (%)
Margin decimals
2
Show column headers. Use separators for sales and profit. MarginPct already holds percentage points: 31.66 means 31.66%, so do not multiply it by 100 again.
Check your result
Run the workflow and open the Browse tool attached to Basic Table. Inspect the formatted table: it should show 12 products, with TotalSales, TotalProfit and MarginPct for each one.
If the embedded page is unavailable, use the direct link above.
Reporting workflow
6 · Join the report pieces
Assemble the report pieces
Join
Reporting tools create report snippets: formatted elements stored in fields such as Chart and Table. Join brings those two fields into the same record so Layout can arrange them together.
Connect Interactive Chart to the left input of Join and Basic Table to the right.
Inspect both inputs and confirm that each contains one report record.
Configure Join by record position and use the J output for the next tool.
The chart branch and table branch each produce one record. How can you put both report fields in one record?
Configuration
Connect Interactive Chart to Join Left and Basic Table to Join Right. Choose Join by record position; retain Chart and Table. Use J. Verify one record on each input before joining.
Check your result
One joined record contains Chart and Table. Do not apply this shortcut to unrelated raw datasets or multiple grouped reports.
If the embedded page is unavailable, use the direct link above.
Reporting workflow
7 · Write the report text
Write the report text
Report Text
Report Text creates a formatted text element that will appear alongside the chart and table. A useful report tells the reader what was measured, what the results show, and how far the conclusion can go.
Attach Report Text to the J output. Create a new Text field and retain Chart and Table.
In the rich-text editor, write a title, scope, finding, and limitation using the product results.
Include a number that supports your finding and identify the measure used.
Write a title, the scope, one finding supported by a number, and one limitation.
Configuration
Use the rich-text editor. Include both observed periods, all products, source units, and your finding. Do not insert the raw Table field as plain text in the text editor. The table will be arranged separately.
Check your result
Identify the leading product and explain which measure you used.
If the embedded page is unavailable, use the direct link above.
Reporting workflow
8 · Arrange the page
Arrange the page
LayoutBrowse
Layout combines the Text, Chart, and Table snippets into a single report field. Its ordering and sizing determine how the reader encounters the evidence.
Attach Layout to Report Text.
Arrange the three fields vertically in reading order.
Attach Browse to Layout and run the workflow to preview the assembled report.
In what order should a reader encounter the report elements?
Configuration
Choose Each Individual Record, Vertical, and order the fields Text, Chart, Table. Use 100% width and modest padding. Connect Browse to preview.
Check your result
One Layout field contains the assembled report. Check the chart labels, headings and table widths before exporting.
If the embedded page is unavailable, use the direct link above.
Relative paths
9 · Set the file paths
An address and directions
An absolute path is a complete address, such as C:\Users\Student\Documents\Reporting\data\Sales.csv. A relative path gives directions from the saved workflow’s folder. Keeping the project folders together allows the same directions to work on another computer.
Save the workflow in the extracted project folder before configuring relative paths. The folder containing the .yxmd file is your starting point.
Location in the project
Purpose
Reporting/8.5_Report_Start.yxmd
Saved workflow: start here
Reporting/data/Sales.csv
Source data
Reporting/output/Product_Report.pdf
Finished sales report
Reporting/output/Product_Margin_Report.pdf
Finished margin report
Read a relative path
Path part
Directions
.\
Start in the workflow’s folder.
data\
Enter the data subfolder.
..\
Move up one folder before following the remaining path.
.\data\Sales.csv
From the workflow folder, enter data and open Sales.csv.
.\output\Product_Report.pdf
From the workflow folder, enter output and write Product_Report.pdf.
If you move the workflow into a subfolder named workflows, the input becomes ..\data\Sales.csv: move up to the project folder, then enter data. Keeping the workflow at the project root avoids that extra level.
Extract the ZIP fully and keep the data and output folders beside the workflow.
Save your workflow in that project folder. Confirm Input Data points to .\data\Sales.csv.
Confirm the output folder exists. In the next step, choose a specific PDF output file in Render and use .\output\Product_Report.pdf.
When handing off the project, include the workflow and both folders. Test the extracted copy from a different folder to check that the paths still resolve.
Render exports the formatted PDF in this workflow. Output Data is used when you need a separate data file such as a CSV; that file contains values rather than the assembled report layout.
Practice the directions
Your workflow is in Reporting and the CSV is in Reporting/data. What path reaches the CSV? If you move only the workflow into Reporting/workflows, how does that path change?
Check
.\data\Sales.csv becomes ..\data\Sales.csv.
Screenshots · Step 9
Report output
10 · Render and inspect
Render and inspect
Render
Render writes the assembled Layout field to a report file. Use PDF so the reader can open the finished report without Alteryx.
Attach Render to Layout.
Choose PDF, select the Layout data field, and configure the output destination using the paths from the previous step.
Run the workflow, open the exported PDF, and inspect the entire report.
How will you deliver a formatted report to someone who does not use Alteryx?
Configuration
Choose PDF and Data Field = Layout. The supplied solution renders a temporary PDF: open its result link and save it to output/Product_Report.pdf. For repeatable delivery, choose a specific output file in Render and browse to that same folder. Use Letter portrait; adjust to landscape if needed. Keep margins and labels readable.
Check your result
Open the actual PDF. Verify every bar, all 12 table rows, period labels, no cropped columns and sensible page breaks. A CSV from Output Data does not preserve the assembled report.
If the embedded page is unavailable, use the direct link above.
Report output
11 · Change the measure
Change the question
SortInteractive ChartRender
Which product has the highest profit margin? Does your sales chart answer that question?
Configuration
Duplicate the completed workflow before revising.
Change Sort to MarginPct descending and use MarginPct as the chart measure. Update the title and axis to percentage points. Keep the table and revise the written finding. Save a second PDF as Product_Margin_Report.pdf.
Check your result
Regular Espresso: 50.98% margin, sales 6,744, profit 3,438. Compare the margin ranking with the sales ranking.
If the embedded page is unavailable, use the direct link above.
Try the measure change
This preview uses the independently calculated product totals. Use it to compare rankings after you finish your own report.
Open comparison preview
Lemon24,048
Caffe Mocha21,716
Chamomile19,295
Decaf Espresso18,888
Darjeeling17,758
Earl Grey16,546
Decaf Irish Cream14,831
Caffe Latte8,665
Green Tea8,520
Mint8,342
Amaretto6,781
Regular Espresso6,744
Lemon ranks first by Total sales.
View accessible data table
Product
TotalSales
TotalProfit
MarginPct
Lemon
24,048.00
7,614.00
31.66
Caffe Mocha
21,716.00
4,687.00
21.58
Chamomile
19,295.00
7,006.00
36.31
Decaf Espresso
18,888.00
7,039.00
37.27
Darjeeling
17,758.00
6,976.00
39.28
Earl Grey
16,546.00
5,975.00
36.11
Decaf Irish Cream
14,831.00
3,201.00
21.58
Caffe Latte
8,665.00
2,716.00
31.34
Green Tea
8,520.00
89.00
1.04
Mint
8,342.00
1,286.00
15.42
Amaretto
6,781.00
1,352.00
19.94
Regular Espresso
6,744.00
3,438.00
50.98
Documentation
12 · Document the workflow
Make the workflow understandable
Documentation explains the purpose of each branch and makes the finished analysis easier to review or update.
Arrange the workflow from left to right: source, numeric summary, reporting branches, assembled report, and PDF.
Edit tool annotations to explain the business purpose, such as “Total sales and profit by product” and “Rank products by sales”.
Document that MarginPct is total profit divided by total sales × 100, and identify the periods covered.
Label the chart and table branches. Record why Join by record position works here: each branch produces exactly one report record.
Save the workflow. Keep the data and output folders together for handoff.
Could another analyst locate the numeric summary, explain the margin calculation, and reproduce both reports from this project?
Screenshots · Step 12
Review activity
13 · Review the state report
Download and run the completed state-report workflow. Inspect its numeric Browse, reporting fields and rendered PDF. It ranks states by total profit; it is different from the product demo.