Context filters - j5 - 28.0 - Administration & Configuration - Hexagon

j5 IndustraForm Designer Help

Search by Category
Administration & Configuration
j5 Version

We now have two data import formulae that need to apply the same area filter, and in a more fully-fledged Handover IndustraForm there could be even more. In order to reduce the repetition, we can move the common filter condition out of the individual formulae and specify them once for the section. This is done using a Context Filter formula on the Sections tab (see 1. in the diagram below):

=FILTER.AREA(FilterInput, "Unit 1")

FilterInput is a special keyword that is used in Context Filter formulae as a placeholder for the import function. It is also possible to apply more than one filter, for example =FILTER.AREA(FILTER(FilterInput, "status=?", "Open for Approval"), "Unit 1") Filters are ignored if the imported data set does not have the column that the filter condition references. It is also worth noting that Context Filters are inherited by sub-sections.

After specifying a Context Filter, we can remove the area filters from the formulas.

After that change, we can duplicate the design for Unit 2, but change the Context Filter.

The Context Filter is not applied to the result of a formula, but is rather applied to each IMPORT function in the formula. In our example above the context filter is set to =FILTER.AREA(FilterInput, "Unit 1"). In this case, the formula

=FILTER(IMPORT.LOG("handover_logbook", "UnitSummary"), "status=?", "Open for Approval") is equivalent to

=FILTER(FILTER.AREA(IMPORT.LOG("handover_logbook", "UnitSummary"), "Unit 1"), "status=?", "Open for

Approval") rather than =FILTER.AREA(FILTER(IMPORT.LOG("handover_logbook", "UnitSummary"), "status=?", "Open for Approval"), "Unit 1"). Of course, in this example, the result is the same, but this can have important consequences for other formulas.