This example shows an instance of the DataSubset specialization of the WhereClause class that defines a compound expression for "Example flag 1 is not missing or N". The compound expression of this data subset:
- Negates another compound expression that specifies that the value of the EXMPFL variable in the ADVS dataset is missing or the value of the EXMPFL variable in the ADVS dataset is equal to "N".
- Could be expressed as:
NOT (ADVS.EXMPLFL EQ '' OR ADVS.EXMPLFL EQ 'N')
Note that this is a relatively simple example that has been created to illustrate the use of "NOT"; in practice, it would be better to simplify this criterion by using the logically equivalent inverse criterion: ADVS.EXMPLFL NE '' AND ADVS.EXMPLFL NE 'N'
. The "NOT" logical operator would generally only be used to negate either:
- more complex compound expressions where the logically inverse criterion is more difficult to express, or
- compound expressions in which subclauses are referenced by identifier values (as described in the AnalysisSet and GroupingFactor sections).
Lines 1-5: | Show the attributes of the DataSubset specialization of the WhereClause class:
|
Lines 6-7: | Show the attributes of an instance of the CompoundSubsetExpression specialization of the WhereClauseCompoundExpression class (because this is a compound expression within a DataSubset class):
|
Lines 11-12: | Show the attributes of an instance of the WhereClauseCompoundExpression class (because this is a compound expression within a WhereClause class):
|
id: DSS-EXMPL-NOT label: Example flag is not missing or N level: 1 order: 1 compoundExpression: logicalOperator: NOT whereClauses: - level: 2 order: 1 compoundExpression: logicalOperator: OR whereClauses: - level: 3 order: 1 condition: dataset: ADVS variable: EXMPLFL comparator: EQ value: - level: 3 order: 2 condition: dataset: ADVS variable: EXMPLFL comparator: EQ value: - N
This compound expression could be represented in tabular form as shown in the following table where:
- Each instance of the WhereClause class (and its DataSubset specialization) is represented on a separate row.
- The values of the id and label attributes of the DataSubset class have be propagated onto all rows representing subclauses within the defined data subset.
id | label | level | order | logicalOperator | dataset | variable | comparator | value |
---|---|---|---|---|---|---|---|---|
DSS-EXMPL-NOT | Example flag is not missing or N | 1 | 1 | NOT | ||||
DSS-EXMPL-NOT | Example flag is not missing or N | 2 | 1 | OR | ||||
DSS-EXMPL-NOT | Example flag is not missing or N | 3 | 1 | ADVS | EXMPLFL | EQ | ||
DSS-EXMPL-NOT | Example flag is not missing or N | 3 | 2 | ADVS | EXMPLFL | EQ | N |