Altova MapForce 2023 Enterprise Edition

In this step, we will filter the data from MergedLibrary in such a way that only the books published after 1900 will be passed to the FilteredLibrary component. We will use a Filter component for this purpose.

 

Add a filter

To add a filter, right-click the connection between MergedLibrary and FilteredLibrary and select Insert Filter: Nodes/Rows from the context menu.

MF_Tut3_FilterData1

The filter component has now been added to the mapping (see screenshot below).

MF_Tut3_FilterData2

As shown above, the bool input connector is highlighted in orange, which means that an input is mandatory. If you hover over the connector, you will see that an input of type xs:boolean is required (see screenshot below). To see tips, click ic-show-lib-info (Show tips) in the toolbar.

MF_Tut3_FilterData3

 

Only books after 1900

The filter component requires a condition that returns either true or false. When the Boolean condition returns true, the data of the current publication sequence will be copied over to the target. When the condition returns false, the data will not be copied. In this tutorial, the required condition is to filter all the books that were published after 1900. To create the condition, do the following:

 

1.Click Constant in the Insert menu. Add a constant with the value 1900. Choose Number as a type.

2.In the Libraries window, locate the greater function and drag it to the mapping pane.

3.Make the mapping connections to and from the greater function, as shown below. By doing this, you are instructing MapForce to copy the current source <publication> element to the <publication> element in the target component when publish_year is greater than 1900.

MF_Tut3_FilterData4

 

© 2017-2023 Altova GmbH