|Available in: Logi Info|| Source code name: SqlCompareFilter|
In cases in which performance is most important, one or more SqlCompareFilter element may be added as children to compare and evaluate data values. The SqlCompareFilter is often easier to use than a large SqlConditionFilter. First, add child SqlCompareFilter elements that return True or False depending on data values. Then write the Condition so it uses just ANDs, ORs and parentheses, and @Compare tokens that match the IDs of SqlCompareFilter elements.
Example with just SQL condition, without SqlCompareFilters:
SqlExpression = "@Data.Freight~ > 50 AND ('@Data.CustomerID~' = 'HANAR' OR '@Data.CustomerID~' = 'MAGAA') "
Example with SqlCompareFilters:
Condition = "@Compare.compareFreight~ AND (@Compare.compareCustomer1~ OR @Compare.compareCustomer2~) "
<SqlCompareFilter ID="compareFreight" DataColumn="Freight" CompareType=">" CompareValue="50" />
<SqlCompareFilter ID="compareCustomer1" DataColumn="CustomerID" CompareType="=" CompareValue="HANAR" />
<SqlCompareFilter ID="compareCustomer2" DataColumn="CustomerID" CompareType="=" CompareValue="MAGAA" />
Basic comparison operations.
The CompareValue must include two pipe ("|")separated numeric or date values. Rows with column values equal to or within the range remain.
Rows with DataColumns containing the CompareValue string value remain.
InYear, InMonth, InQuarter, InWeek and InDay match when the dates being compared are within the same time-span.
DataColumn values that match an item in a comma-delimited list.
Rows with column values that do not contain the CompareValue remain.
DataColumn values that do not match any item of a comma-delimited list.
DataColumn values that do not start with the CompareValue remain.
DataColumn values that start with the CompareValue remain.