Creating Dynamic Queries using Parameters
Ensuring queries are usable year over year and quarter over quarter, is essential to creating a streamlined reporting process. To do this in Workiva’s Data Management Suite, you can create a dynamic query that fits your reporting process by using Parameters. Parameters are dynamic filters where the value of that filter is selected at the time the query is run.
Common fields to create parameters for are:
- Year
- Quarter/Reporting Period
- Entity
- Account
The primary benefit of using Parameters in your queries, instead of hard coding filters, is that you can use the query in the future without needing to edit the filters. It also makes it easier for end users in the Workiva Platform to set up connections to that query in a way that gives them the exact data they need, without needing to update the filters within Wdata.
There are two types of parameters:
- Global Parameters - are created and managed at the Workspace level. These can be used across any Query in the Workspace. These are helpful for when a Parameter can be used in any Query and the values of that Parameter need to be regulated.
- Query Parameters - created and managed at the Query level. These are helpful for one off use cases where the filter values can change based on the data in the Table.
Helpful tips to remember when creating a Parameter:
- Make sure that you select the appropriate parameter type - this should align with the column type in the data source for the column you are filtering
- When creating a picklist, make sure that each value listed out matches exactly how it appears in the dataset
- Connect the parameter to the source column - this is how the Query will know which field in your Table to filter
Once the parameter has been created and the Query has been saved, you can set up connections to the Workiva Platform. You will be asked to select the Parameter value when setting up that connection. Then, when refreshing a connection that has a parameter, you can update the parameter value by clicking into the gray space of the connection, which opens up the Query parameters.
Last but not least, you can also set Query parameter values in Chains using the Run Query and Refresh Connections commands. When configuring the command, you will create a section for the Parameter name and Parameter value, populating the parameter value with the value to filter the Query on.
Please sign in to leave a comment.
Comments
0 comments