Did you recently watch the Wdata Foundations Webinar and want to practice at your own pace? This Connected Learning Path will walk you through setting up Tables and Queries based on the webinar.
| Primary Business Use Case | Automating reporting workflows |
| Primary Learning Objective | Learn foundational building blocks of Wdata concepts |
Step 1: Create Fact Table and Dimension Table
First, let's create the Wdata Tables to store our data. One table will hold company spend data, which will grow over time, while the other will store department mapping data, which remains mostly static.
Create the Fact Table (Company Spend Data)
- Navigate to Wdata and complete the steps to create a Table for the Company Spend data
- Create a new Table with the following properties:
- Table Name: CLP Company Spend
- Table Type: Fact
- Add Table Columns by using a sample file
-
- Click here to download the Company Spend sample file.
- Click Choose Source
- Select Upload File and browse to find the recently downloaded ERP file
- Click Add Columns
-
Update the columns to the appropriate data type:
Display Name Column ID Type Import Format Year year Integer Period period Text Department department Text Region region Integer Company company Text Amount_ytd amount_ytd Decimal 1,000.00
-
- Click Create Table
- Click Add Data
-
Create the Dimension Table (Department Mapping Data)
- Table Name: CLP Department Mapping
- Table Type: Dimension
- Add Table Columns by using a sample file
-
Click here to download the department mapping data
- Click Choose Source
- Select Upload File and browse to find the recently downloaded mapping file
- Click Add Columns
- Update the columns to the appropriate data type:
| Display Name | Column ID | Type | Key |
| department | department | Text | Checked |
| department_name | department_name | Text |
-
- Click 'Create Table' and 'Add Data'.
Step 2: Create a Query
Now that we’ve created our Tables, let’s move on to Queries. Queries help us organize and aggregate our data effectively. Follow these steps:
- From Wdata Home, click Create , and select Query
- In the Query Properties panel, set the query's properties
- Query Name: CLP Company Spend by Department
- For additional help, refer to the Create a Query documentation
Step 3: Add Sources
To build a Query, we first need to specify the data source. In this case, we are using the CLP Company Spend Table and CLP Department Mapping Table. Adding these sources will give our Query access to their data, columns, and structure.
- Click New source
- Select Table
- In the Add Table Data screen, check:
- CLP Company Spend Table
- CLP Department Mapping Table
- Click Add
Step 4: Add Fields to Query
Now that we’ve selected our data sources, let’s choose the fields we want to include in the Query.
- Click the arrow next to the CLP Company Spend source to expand and show all columns
- Drag and drop the following fields to the Fields area:
- YEAR
- PERIOD
- COMPANY
- AMOUNT_YTD
- Drag and drop the following fields to the Fields area:
- Click the arrow next to the CLP Department Mapping and drag DEPARTMENT_NAME into the Fields area.
Step 5: Add Query Relationships
The source Tables may show a warning flag. To combine data from both Tables, we need to define their relationship. Since both Tables share a Department code, we will use it to join them
- Navigate to the Relationships tab.
- Drag the Department field from CLP Company Spend Table to Join 1 (left side).
- Drag the Department field from CLP Department Mapping Table to Join 1 (right side).
- The warning flag will disappear once the connection is set.
Step 6: Create a Parameter and Filter Query Filters
Running the Query now will return data for all companies and periods. To focus on relevant data, we’ll filter the results by Company and Period while making the Query dynamic using Parameters.
Create the Parameter
- Navigate to the Parameters panel
- Click Add Parameters and select Create New Parameter
- Name the Parameter: Period
- Enable the Pick List
- In the List Options box, enter:
- 01, 02, 03, ..., 12 (each on a new line)
- Set Default to None, then click 'Create'
Add the Filter
For the Parameter to control the results of our Query, we need to connect the Parameter to the column in the source data using Filters.
- Navigate to the Filters tab in the Query.
- Locate & Drag Period from the Source Data panel to the Filters area(left side).
- Click on the filter value, where it says Empty String, in order to populate the filter value
- To the right of the filter value field, click on the parameters button
- Select Period and click Apply.
- Repeat the process to create a second filter for Company:
- Drag Company from CLP Company Spend Table to the Filters area.
- Enter 1000 as the filter value.
- Click Apply
Step 7: Sort Query Results
To make our Query results easier to read and understand, we will add a sort order.
- Navigate to the Sort tab
- Click and drag the Department Name field to the Sorted area
- Save the Query
- Click Run Query to see an output of the Query results
- Fill in the parameter value with Period = 01
Step 8: Create an Incoming Connection
To ensure end users can access the data easily, we will connect the Wdata Query to a Spreadsheet.
- In Workiva Platform, create a new Spreadsheet
- Name the Spreadsheet: CLP Company Spend
- Name the first Sheet: CLP Company Spend by Department
- Add an Incoming Connection
- Add the connection from the Data toolbar or Connections panel
- Click Add Connection , Wdata Query .
- Select the CLP Company Spend by Department Query
- In the Parameters Section, select Period = 01
- Click Connect
- The dataset will refresh and will be populated on the spreadsheet
Next Steps
Follow along in the next Connected Learning Path to create a Chain that adds data to our Table and refreshes the connection to bring the new data into the Spreadsheet!