Previous Topic: FILTER and UNFILTER StatementsNext Topic: UNFILTER Statement for a Group View


FILTER Statement for a Group View

 --- EVENT ACTION filter_ok
|    CLOSE Dialog Box filter 0
|    CLOSE Dialog Box filter
|    SET local_filter_big ief_supplied filter_big_field TO SPACES
|
|     --- FOR SUBSCRIPT OF export_selected_filter FROM 1 TO LAST OF
|    |        export_selected_filter BY 1
|    |     --- IF subscript of export_selected_filter IS EQUAL TO 1
|    |    |    SET local_filter_big ief_supplied filter_big_field TO
|    |    |        concat (trim(local_ filter_big ief_supplied
|    |    |        filter_big_field),
|    |    |        export_line_selected_filter ief_supplied
|    |    |        filter_input_statement)
|    |    |--- ELSE
|    |    |    SET local_filter_big ief_supplied filter_big_field TO
|    |    |        concat (trim(local_ filter_big ief_supplied filter_big_field),
|    |    |        concat (“ “,export_line_selected_filter ief_supplied
|    |     ---         filter_input_statement)
|     ---
|
|     --- CASE OF output_meta_entity ief_supplied meta_entity_name
|    |--- CASE “JOURNAL”
|    |    FILTER export_je BY local_filter_big ief_supplied
|    |        filter_big_field),
|    |--- CASE “ACCOUNT”
|    |    FILTER export_account BY local_filter_big ief_supplied
|    |        filter_big_field),
|    |--- CASE “DEPT”
|    |    FILTER export_department BY local_filter_big ief_supplied
|    |        filter_big_field),
|     --- OTHERWISE
 ---

It uses data similar to that described for the SORT statement to populate the dialog box shown in the illustration in FILTER and UNFILTER Statements.

The logic in the FOR loop constructs the filter expression from the options specified in the FILTER dialog box.

The CASE logic filters the applicable group view.

After a group view is filtered, it must be unfiltered to display all group view occurrences. This is shown in the next sample code.