13.07.2015 Views

Reports & Queries - Source : www.pcsoft-windev-webdev.com

Reports & Queries - Source : www.pcsoft-windev-webdev.com

Reports & Queries - Source : www.pcsoft-windev-webdev.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.3.3 Operations that can be performed in a Select queryThe query editor allows you to perform operations on the values of an item. The possible operations are:• the sum of the item values.• the average of the item values.• the calculation of the minimum value for all the values of the item.• the calculation of the maximum value for all the values of the item.These operations are performed:• on all the records selected by the query.• on subsets of records (automatically grouped by the query).For example, you can find out:• the total amount of the orders placed by the customers living in Paris,• the order with the smallest amount,• the average sum spent by the customer named Darwin,• the total order amount per country and per year,•…The operations are defined when creating the query. However, you have the ability to add, modify or deletethe operations performed in a query. These operations are described in the following paragraphs.Caution: If the query result is displayed in a report, the operations to perform on the value of the items mustbe defined when describing the report. See the “How do I create a report?”, page 25 for more details.To add an operation into the current Select query:1. Select "Query description" from the popup menu of the query. The description window of the query isdisplayed.2. In the middle section of the window, select the item on which an operation must be performed.3. To calculate:• the sum of the item values, click the "Sum" button.• the average of the item values, click the "Average, Max, Min" button and select "Average".• the maximum value for all the item values, click "Average, Max, Min" and select "Maximum".• the minimum value for all the item values, click "Average, Max, Min" and select "Minimum".4. Validate. The operation is automatically added to the query.To delete an operation from the current Select query:1. Select "Query description" from the popup menu of the query. The description window of the query isdisplayed.2. In the middle section of the window, select the calculation item to delete.3. Press the [Del] key (or select "Delete the item" from the popup menu of the item).3.3.4 Modifying the values displayed in the result of a Select queryIn the result of a Select query, you have the ability to only display:• the year from a date item.• the month from a date item.• the state from an item containing a zip code.To modify the values displayed in the result of the current Select query:1. Select "Query description" from the popup menu of the query. The description window of the query isdisplayed2. In the middle part of the window, select a date item or an item containing a zip code.Part 2: Query editor 195

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!