Element Details: DsCondition+Filter
 Back


Available in: Logi Info Source code name: DsConditionFilterIntroduced 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



ATTRIBUTES

Click attribute Name to drill down for more information.

NamePossible ValuesDescription
DsExpression
UserDefined
(Required) DsExpression is a DataServices formula which returns a value. To represent the value of a data column, wrap the column name in square brackets. Example expression: [Weight] * [PricePerPound] + .05
ID
UserDefined
The ID attribute is a pervasive attribute that uniquely identifies an element within a definition file. The ID needs to be a unique value within the definition.
IncludeCondition
True
False
An expression that evaluates to a value of True or False. If the expression is blank, or evaluates to true the element is processed. If the expression evaluates to false, the element is skipped. Expressions should be in VBScript or JavaScript syntax. For .NET versions, the scripting language can be set in the _settings.lgx General element. For Java versions, the scripting language is always JavaScript. Typically, you would compare values using an operator, such as "@Session.value~ < 0". Use quotes when working with strings: "@Session.myValue~" == "SomeValue"



PARENT ELEMENTS

Click element to drill down for more information.

DataLayer.Data Services


CHILD ELEMENTS

Click element to drill down for more information.

DsCompareFilter


 Back to top


 Chart Debug