Available in: Logi Info | Source code name: DsConditionFilter | Introduced in: 12.5 |
DsConditionFilter adds a row filtering operation to a Dataview for DataLayer.DataServices. It removes rows which do not match the DsExpression.
The DsExpression, which is a formula, is evaluated for each row, then removes rows when the result is False.
DsCompareFilter elements may be added as children to compare and evaluate data values. The DsCompareFilter may be easier to organize when building a complex filter. First, add child DsCompareFilter elements that return True or False depending on data values. Then write the DsExpression so it uses just "ands", "ors", parentheses, and @Compare tokens that match the IDs of CompareFilter elements.
Example, without DsCompareFilters: DsExpression= "[Freight] > 50 and ([CustomerID] == 'HANAR' or [CustomerID] == 'MAGAA') "
Example with DsCompareFilters: DsExpression = "@Compare.compareFreight~ and (@Compare.compareCustomer1~ or @Compare.compareCustomer2~) "
<DsCompareFilter CompareType=">" CompareValue="50" DataColumn="Freight" DataType="Number" ID="compareFreight" /> <DsCompareFilter DataColumn="CustomerID" ID="compareCustomer1" CompareValue="HANAR" DataType="Text" CompareType="=" /> <DsCompareFilter DataColumn="CustomerID" ID="compareCustomer2" CompareValue="MAGAA" DataType="Text" CompareType="=" />
Element Group:Filter Rows |