Queries are a higher-level object in a catalog. The concept is similar to that of views in the database but they are stored in the catalog file rather than the database itself. In this way, a query is independent from the raw database since Logi Report uses a mapping name that is unique instead of the table.column syntax of SQL. You can use queries to view, change, and analyze data in different ways, and Logi Report can help you with the building of various professional reports based on queries. When making a query, you can place criteria or restrictions on the data to extract only the required data from the database. For example, instead of having to view all the customers of your company, you can view just the customers from Japan.
Designer includes an interactive Query Editor to build queries. The following shows an example of creating a query with the editor using the data that have been retrieved from the SQL Server database in the previous topic.
- Select New Query in the New Queries or Business Views dialog box that Designer prompts after you finish adding tables from the database into the Logi Report catalog (if the dialog box does not show up, select Resume on the Catalog Manager toolbar).
- In the Enter Query Name dialog box, type the name of the query and select OK.
- In the Add Tables/Views/Queries dialog box, expand the connection > Tables node, the database tables that have been added into the catalog are listed. Add the tables you want to use in the query.
You can also combine tables, views, synonyms, imported SQLs, stored procedures, user-defined data sources, and other existing queries into a query to mash up multiple data resources in a single query, and create distributed joins to set up inter-relationships between the data resources.
- In the Query Editor dialog box, select the columns in each table that you want to use in the query and join the tables to make them interrelated.
The Query Editor dialog box provides many features for customizing a query. For example, you can filter the data to be retrieved from the database for the query so that when you build reports on the query, the returned results will be narrowed down.
- Select OK to create the query. Designer adds the query in the catalog and prompts what you can do next. You can create a business view based on the query or use the query to create a page report.