Dynamic Datasets and Customizable Parameters for Data Analysis
In our previous blog, we unveiled the magic of Flowtrail AI’s Text-to-SQL functionality, which empowers users to craft complex queries using natural language. This innovation eliminates the need for deep SQL expertise, making data analysis more accessible than ever. Today, we’re excited to delve into Flowtrail AI’s advanced capabilities—specifically, its dynamic datasets and customizable dataset parameters. These features offer unparalleled flexibility and control, allowing users to generate highly customizable datasets and elevate their data exploration experience.
Understanding Flowtrail AI Dataset Parameters
Dataset parameters in Flowtrail AI function like adjustable settings for your data. Available in various formats such as text, numbers, dates, and even custom SQL queries, these parameters can be customized with unique names, default values, and specifications for whether they are mandatory or optional. This flexibility enables the creation of tailored queries without the need for complex coding.
Types of Dataset Parameters
- String: Tailor your queries with text-based inputs.
- Number: Inject numerical values for precise control.
- Date: Specify dates for time-bound analyses.
- Select: Choose from predefined options for streamlined selection.
- Multi-Select: Pick multiple values for comprehensive filtering.
- SQL: Craft custom SQL queries within parameters for advanced control.
Each parameter type has its unique characteristics:
- Variable Name: A user-defined name for the parameter, ensuring clarity.
- Default Value: A pre-set value for the parameter if left unspecified.
- Required vs. Optional: Define whether the parameter is essential for the query.
Crafting Your Dataset
Let’s illustrate how to create a dynamic dataset using Flowtrail AI’s features. Suppose we want to retrieve salary process details by year. Here’s a SQL query generated by the Text-to-SQL feature for the year 2024:
SELECT id, name, startDate, endDate, paymentDate, totalAmount
FROM employee_payroll
WHERE YEAR(startDate) = 2024
To make the year dynamic, we can use a parameter. We will add a Select
parameter named selectedYear
.
Adding a Parameter to the Dataset
- Name the Variable: In the form, name the variable
selectedYear
. - Choose Parameter Type: Select the
Select
option from the parameters list. - Enter Values: Enter your select values, separating them with commas. For a default value like the current year, select it from the Default value column.
- Set Required Status: Since
selectedYear
is necessary to retrieve data based on the ‘where’ condition, check the ‘required’ checkbox.
Integrating the Parameter into the Dataset
Replace the year 2024 with our variable name selectedYear
in the following format: '{{selectedYear}}'
. The modified SQL query becomes:
SELECT id, name, startDate, endDate, paymentDate, totalAmount
FROM employee_payroll
WHERE YEAR(startDate) = '{{selectedYear}}'
This change makes the dataset more dynamic and flexible, allowing users to retrieve specific data based on their chosen year. This is just one example of how Flowtrail AI’s customizable dataset parameters can enhance your data exploration experience.
Parameters with Optional Values
In some instances, parameters will be optional. If a parameter value is present, the query will execute based on that parameter; if not, it will execute without it, offering greater flexibility in analytics.
Consider this query to get employee salary details:
SELECT e.id, e.firstName, e.lastName, es.totalSalary
FROM employee e
JOIN employee_salary es ON e.id = es.employeeId
To filter employees by their name, we will add a text-based parameter called employeeName
. If an employee name is provided, the query will display that employee’s salary; if no name is given, it will display the salary details of all employees.
Implementing Optional Parameters
SELECT e.id, e.firstName, e.lastName, es.totalSalary
FROM employee e
JOIN employee_salary es ON e.id = es.employeeId
{`% if employeeName %}
WHERE e.firstName LIKE '%{{employeeName}}%'
{% endif %`}
This SQL query uses an ‘if’ statement to check whether an employeeName
is provided. If it is, the query adds a ‘WHERE’ clause to filter by the specified name. If not, it retrieves all salary details.
Conclusion
Flowtrail AI’s dataset parameters open a world of possibilities for crafting highly customized and dynamic data explorations. With a variety of parameter types, unique names, and control over required vs. optional fields, you can tailor your queries to perfectly suit your analytical needs.
Stay tuned for our next blog post, where we’ll delve deeper into creating reports using these dynamic datasets. Happy exploring with Flowtrail AI!
10 Jun-2024
Related blogs:
Visualize your MYSQL data with Flowtrail AI
In the busy field of data analytics, quickly getting useful information from big datasets is very important. But for many, pulling out, studying, and showing this data can be tough. It often needs special skills and hard-to-use tools. Here comes Flowtrail – a new AI data analytics tool. It's built to change how you work with your MySQL data.
Introducing Text to Reports - A new way to visualize your data using Flowtrail AI.
Visualizing data is important so that it can communicate patterns and provide insights into trends. In addition to making better decisions, it can help you communicate your findings to your audiences and persuade them. However, creating a data visualization is always challenging. The process requires expertise in a variety of tools and languages.
Text to SQL - Simple way to generate the SQL in Flowtrail AI
Keeping your business competitive today requires being able to extract insights from vast amounts of data quickly and efficiently. A significant barrier for many users is the need to know SQL and complex data visualization tools in order to query data or generate reports.Flowtrail AI, an AI-powered reporting and analytics tool, is designed to democratize data access and analysis. In Flowtrail AI, users are able to generate complex SQL queries with the help of simple, natural language inputs, which makes it a standout feature.
Subscribe to our newsletter
Stay up to date with the latest insights and updates from Flowtrail AI. Subscribe to our newsletter and never miss a beat.