Query Wizard¶
Query wizard is a tool for visually creating structured datamart queries without prior knowledge of SQL or other database technology. Query wizard allows the user to select a table and then filter records based on conditional expressions constructed using drop down boxes. Each conditional expression involves an operation: a field to filter on (the source field), an operator (equals
, greater/less than
, in the range of
, etc.) and a value supplied by the user. An example of a condition operation would be a query that returns records where the City
field in the customer table is equal
to "Chicago"
. By combining one or more such operations, users can retrieve records from the datamart that are relevant to the questions they have.
Query wizard is one of three tools Daybreak provides for accessing data. Users wanting a simpler way to answer questions may want to use Natural Language Answers, an easy-to-use tool for building queries using questions phrased in natural language, similar to a Google search. Advanced users may benefit from the power of the Daybreak SQL Builder which allows you to write datamart query code directly using the SQL language.
Creating a New Query¶
To access the Data Builder, log in to the Daybreak app or click the Data Builder icon on the blue menu bar at the left of the screen if you are already logged into the app.
Once a new query has been created, you can begin simple query construction using the Wizard.
Basic Query Construction¶
Query Wizard allows you to display the fields in a datamart table filtered upon one or more conditions. The first step is to select a table you would like to use as the source data to filter on with this query.
To select the source table, click the drop down menu labeled "Show me" and select a source you would like to use. For example, select the Customer
table if you are interested in customer data to filter on that table and its fields. After selecting a source table, your query is technically complete and can be run to simply get a list of all records in the customers table. Occasionally you may wish to do this, but usually you will want to add some sort of filtering condition. To add one, click the "Add condition" button below the library selector.
Filter conditions are composed of three parts: A Field to filter on, an operator, and a filter value. In this example, we want to get a list of customers who have a debit card, so we select the HasDebitCard
field from the field drop down menu.
Because we want to find customers who have a debit card, we will select the "Equals" operator. For numerical fields, different operators are available, for example, "greater than" and "less than."
In order to find customers with a debit card, we need to provide a filter value. In this case, we want customers whose HasDebitCard
field value is equal to "Yes."
When run this query will yield a list of customers who have a debit card. However, it is also possible to specify multiple criteria. For example, to find customers who have a debit card but do not have a credit card, we can add a condition by clicking "Add condition."
We can now add an additional condition. This time, we will select the HasCreditCard
field, the equals operator and "No" as the value to filter the HasCreditCard
field on.
Running this query will now yield a list of customers who have a debit card but also do not have a credit card.
If we want to remove one or more conditions from a query, we can do so by clicking the red minus icon next to the condition we want to remove.