# Query Filters

{% hint style="info" %}
Note! Filters can be combined using an 'AND' or 'OR' rule. All 'AND' filters will be evaluated first.  Only a limited set of filter types are available as 'OR' filters.
{% endhint %}

## Attribute Value Filter&#x20;

Matches Document Objects that correspond to the given value of the selected attribute.&#x20;

First, select the attribute to filter on, then set the **Modifier.**&#x20;

Then, enter the attribute value (or part of the attribute value).

Depending on the attribute type, different attribute modifiers are available.

For Date attributes, the Modifier has the options: **before** and **after**.

For number attributes, such as IntRange and Int Attributes, the Modifier has the options: **equals, notEquals, less and greater**.

For itemized attributes such as Enum Attributes, Boolean Attributes or MultiSelect Attributes, the Modifier has the options: **all**, **any** and **none**.

Approval attributes provide a number of different filter Modifiers:

* The Modifier **assignedToAny** filters on the assigned user name
* The Modifier **locationContains** filters on the text content of the location if active on the attribute
* The Modifier **roleContains** filters on the text content of the role if active on the attribute
* The Modifiers **timeOfApprovalBefore**, **timeOfApprovalAfter** and **timeOfApprovalNotSet** filters on the approval date
* The Modifier **commentContains** filters on the text content of the comment if active on the attribute

Text based attributes, such as Title, String Attributes, Richtext Attributes and Table Attributes, the Modifier has the options: **contains**, **not contains**, **is empty,** or **is not empty, contains exact and not contains exact.**&#x20;

{% hint style="info" %}
**Contains** and **not contains** uses SQL Server full-text indexing. See applicable constraints here: [Stopwords in Full-text](#undefined)

**containsExact** can match parts of words whereas **contains** only looks for full words, i.e. if the filter value is 'user' **containsExact** will match both 'user' and 'users'. **contains** will only match 'user'.
{% endhint %}

Table Attributes also has the Modifier option: **row contains**. This modifier expects the filter value to be on a particular format. The format of the filter value is:

1. The column name
2. The expected value in that column

Thus, Column:Value e.g. Result:Passed.

The filter will look for a Table where a row exists where the column **Result** contains the value **Passed**.

&#x20;It is also possible to search for empty values, using the constant **not assigned** as value.

&#x20;A check on multiple column values in the same row needs to be separated by comma ‘,’.

&#x20;

Example: the filter value for the table attribute **Assigned Users** in **Review** to find Reviews where user **Bill** has not yet completed the review (i.e. the Date value is still empty):

User:Bill,Review Date:not assigned

{% hint style="info" %}
Note! This filter is case-insensitive. Quotes do not apply. Aligned Elements provides the option to use SQL Server full text search to increase the performance of attribute queries, see Using SQL Server Full Text Search
{% endhint %}

## Trace To Filter&#x20;

Matches Document Objects that trace (or not trace) to Document Objects of a given type in given projects. Select the Document Object Type to trace to (can be one or more) then in which Projects these traced objects may reside and finally set the Modifier to either “any”, “all” or “none.”&#x20;

The Modifier work as follows:

* &#x20;Trace to **any** of “Specification”, and “Use Case” yields objects that trace to at least one Specification OR at least one Use Case (or both).&#x20;
* Trace to **all** of “Specification” and “Use Case” yields objects that trace to at least one Specification AND at least one Use Case. &#x20;
* Trace to **none** of “Specification” and “Use Case” yields objects that do not trace to any Specification or Use Case.

## Trace To/From Query Filter&#x20;

Matches Document Objects that trace (or not trace) to/from Document Objects in the Output set of other Queries. You can use this filter to combine Queries. Set the Modifier to “any”, “all”, or “none” and then the Query that contains your target set.&#x20;

The Modifier works as follows

* Trace to **any** yields objects that trace to at least one object in the Target Query Output set. &#x20;
* Trace to **all** yields objects that trace to all objects in the Target Query Output set.&#x20;
* Trace to **none** yields objects that trace to none of the objects in the Target Query Output set.

## Trace From Filter&#x20;

Matches Document Objects that have incoming traces from Document Objects of a given type in given projects. Select the Document Object Type for the incoming traces (can be one or more), then in which Projects these incoming-trace objects may reside and finally set the Modifier to either “any”, “all” or “none.”

The Modifier work as follows:

* Trace to **any** of “Specification” and “Use Case” yields objects that have incoming traces from at least one Specification OR at least one Use Case (or both).&#x20;
* Trace to **all** of “Specification” and “Use Case” yields objects that have incoming traces from at least one Specification AND at least one Use Case.&#x20;
* Trace to **none** of “Specification” and “Use Case” yields objects that do not have incoming trace to any Specification or Use Case.

## Revision Date Filter&#x20;

Matches Document Objects that have been created or modified before or after a certain date. Set the Modifier to **created before**, **created after**, **modified before**, **modified after,** and then set the target date.

## Revision Number Filter&#x20;

Matches Document Objects that have a revision number greater, less, equal, or not equal to a certain number.

## Revision Author Filter&#x20;

Matches Document Objects that have a revision author that has created/not created, modified, or not modified an object.

## Revision Comment Filter&#x20;

Matches the Document Objects where the most current revision has a **Change Comment** containing or not containing a particular word.

## Comments Filter

&#x20;Matches content in the comment for a Document Object.&#x20;

* The Modifier **hasComments** will return a match if any comments have been created for a document object
* The Modifier **hasNoComments** will return a match if no comments have been created for a document object
* The Modifier **contains** filters for any text in the comment.
* The Modifier **author** filters for any comments created by a specific user.
* The Modifier **mentioned** filters for any user mentioned (e.g. @user) in a comment.
* The Modifier **hasStatus** filters based on one of the selected statuses open, resolved, declined for the comment.
* The Modifiers **createdDateBefore** and **createdDateAfter** filters based on the create date for the comment.

{% hint style="info" %}
Note: Comments are revision independent which implies that all revisions of a Document Object will provide the same result. &#x20;
{% endhint %}

## Inconsistency Filter&#x20;

Matches Document Objects that have (or have not) a certain inconsistency. Select the Inconsistency Type and then set the Modifier to either “any”, “all” or “none”.&#x20;

The Modifier work as follows:

* Modifier **any** of Inconsistencies “Issue Open” and “NotReviewed” yields objects that have at least one open issue OR is not Reviewed (or both).&#x20;
* Modifier **all** of Inconsistencies “Issue Open” and “NotReviewed” yields objects that have at least one open issue AND is not Reviewed.&#x20;
* Modifier **none** of Inconsistencies “Issue Open” and “NotReviewed” yields objects that have no open issue AND is Reviewed i.e. that have none of the described inconsistencies

## RPN Filter&#x20;

The filter allows you to define a query based on the calculated Risk Priority Number value. It only applies to document object types such as Failuremode or RiskAnalysis and their underlying Hazard/ProbabilityOfHarm. You can apply the filter before or after Mitigations and include the RPN and/or RPNThreshold values in the query result.

## RPN Threshold Filter&#x20;

The filter allows you to define a query based on the calculated RPN Threshold (e.g. Acceptable, InAcceptable, ALARP/ALAP). It only applies to document object types such as Failuremode or RiskAnalysis and their underlying Hazard/ProbabilityOfHarm.

You can apply the filter before or after Mitigations and include the RPN and/or RPNThreshold values in the query result.

## Function Filter&#x20;

The filter allows you to define a complex condition using C# syntax. The result of the function must be a Boolean (true/false) and as parameters, any Document object attribute string values can be defined where the name of the parameter is the name of the attribute.

## Tag Filter&#x20;

The filter allows you to sort out all Document Objects that belong (or not belong) to one or more tags.

## Signed Filter

This filter is primarily used for File Objects. It filters out items that has (or has not) a Signature with a particular Signature status (as configured in the Signature.rvt).

## Test Run Filter

Document Object types (Test types, Configuration types and Test Result types) that belong to a Test Run can be filtered based on them being part (or not being part of) one or more Test runs.

## Item In Test Run Filter

Document Object Test types that belong to a Test Run can be filtered based on if they are **assignedToAny** or **assignedToNone.**

Document Object Test Result types that belong to a Test Run can be filtered based on them being **executed** or **notExecuted.**

## Filter value 'Contains' and SQL Server Full-text search

Aligned Elements uses SQL Server's full text indexing to provide the fastest possible search results. To prevent a full-text index from becoming bloated, SQL Server has **a mechanism that discards commonly occurring strings that do not help the search**. These discarded strings are called stopwords. During index creation, the Full-Text Engine omits stopwords from the full-text index. &#x20;

Using the filter 'Contains' and 'not Contains' will this not render any matches on words that are considered stopwords by SQL Server.&#x20;

An example of the default stopwords in SQL Server 2016 yields the following list:

·         $

·         0

·         1

·         2

·         3

·         4

·         5

·         6

·         7

·         8

·         9

·         A

·         B

·         C

·         D

·         E

·         F

·         G

·         H

·         I

·         J

·         K

·         L

·         M

·         N

·         O

·         P

·         Q

·         R

·         S

·         T

·         U

·         V

·         W

·         X

·         Y

·         Z

·         about

·         after

·         all

·         also

·         an

·         and

·         another

·         any

·         are

·         as

·         at

·         be

·         because

·         been

·         before

·         being

·         between

·         both

·         but

·         by

·         came

·         can

·         come

·         could

·         did

·         do

·         does

·         each

·         else

·         for

·         from

·         get

·         got

·         had

·         has

·         have

·         he

·         her

·         here

·         him

·         himself

·         his

·         how

·         if

·         in

·         into

·         is

·         it

·         its

·         just

·         like

·         make

·         many

·         me

·         might

·         more

·         most

·         much

·         must

·         my

·         never

·         no

·         now

·         of

·         on

·         only

·         or

·         other

·         our

·         out

·         over

·         re

·         said

·         same

·         see

·         should

·         since

·         so

·         some

·         still

·         such

·         take

·         than

·         that

·         the

·         their

·         them

·         then

·         there

·         these

·         they

·         this

·         those

·         through

·         to

·         too

·         under

·         up

·         use

·         very

·         want

·         was

·         way

·         we

·         well

·         were

·         what

·         when

·         where

·         which

·         while

·         who

·         will

·         with

·         would

·         you

·         your

&#x20;The stopwords list can be edited in SQL Server. If this is desirable, contact your Aligned Elements administrator.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aligned.ch/aligned-elements-web-client-user-manual/3.2.287.25450/queries/query-filters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
