Record filter condition

 


Let us set a filter that excludes the folders of the MaterialsAndServices catalog from the report.

  1. Click the Conditions tab.
  2. Expand the MaterialsAndServicesCat table and drag its IsFolder field to the list of conditions.
  3. Select the Arbitrary check box for this condition and type the following text in the Condition column (listing 13.5).

    Listing 13.5. Query condition

    MaterialsAndServicesCat.IsFolder = FALSE
    This is how you specify that only those records of the MaterialsAndServices catalog that are not folders are selected.

    This condition can be visually described using the following example. On the left you see the source table of the MaterialsAndServices catalog while on the right you see the records that are selected from this table (fig. 13.23).


    Fig. 13.23. Filtering material and service records in a query

    The second condition should state that the selected items must be services. Such conditions are referred to as simple conditions. Let us create it.
  4. Drag the MaterialServiceType field to the list of conditions.

    The platform automatically creates a condition stating that the material or service type must match the value of the MaterialServiceType parameter.

    Later, before the query execution, you will pass the Service enumeration value to the MaterialServiceType parameter.

    This condition can be visually described using the following example. On the left you see the records of the MaterialsAndServices catalog filtered using the first condition. On the right you see the service records only (fig. 13.24).


    Fig. 13.24. Filtering material and service records in a query

    Once you complete the procedure described in this section, the Conditions tab should look as shown in fig. 13.25.


    Fig. 13.25. Creating query conditions

Note. You can specify filters both in the query itself and in the report settings. The same is true for sorting and grouping. We recommend that you specify filters in queries when the records that do not meet the filter condition are definitely not needed in the report. We also recommend that you use sorting and grouping in the report settings to make the report more flexible.


Comments
0
Add comment