Skip to main content

PI dataset filtering

info

Dataset filtering finds source objects, generates models, and saves discovery rules when automatic addition is enabled. First use this page to limit the scope to approved objects, then proceed to PI model configuration files. AF multi-column modeling by template may initialize all instances of that template. The number of matches in a download is not the final collection list.

Entry point: taosExplorer → PI or PI backfill → Data Model Configuration → Dataset Filter.

1. Choose by connection mode​

System and modelFilter unitFinal target granularity
PI Data Archive Only, single-columnpointOne child table per Point.
Data Archive and AF Server, single-columnelement, path, or templateResolve Points from AF element attributes; still create child tables by Point.
Data Archive and AF Server, multi-columnelement, path, or templateOne child table per AF element.

AF single-column mode still requires element and attribute context and cannot use the Data Archive Only point filter. In the meter example, Archive single-column mode uses point to select Meter_001_Voltage. AF multi-column mode uses element or path to select Meter_001, or template to select MeterTemplate.

When configured through a DSN, direct AF filters are selected by the presence of filter_element, filter_path, and filter_template, in that order. They are not intersected. Generic values, filter types, and aliases with model prefixes each have their own precedence. An empty prefixed value may also hide a later, narrower value. Download and review the objects again after each change. For the complete key names, see PI model and filter parameters.

2. Name and path rules​

* matches zero or more characters, and ? matches one character. Exact names do not have * appended automatically. These rules are not regular expressions; do not enter ^Meter.*$.

InputMatch meaning
Meter_001_VoltageComplete Point name.
Meter_001_*Point name prefix for this meter.
Meter_00?Exactly one character at the end of the name.

point and template accept only name patterns. element supports an element name or an exact parent path. path applies wildcard matching to the complete relative path.

2.1 element: name or exact parent path​

An element path is relative to the AF database root and does not include the AF Database name. A rule without \ searches by name. A rule containing \ uses the last \ to separate the exact parent path from the name pattern. Rules containing a path return only matching leaf elements. Do not infer that collection includes a grouping node's own attributes. Name searches without a path do not apply this leaf-only restriction.

InputExplanation
Meter_001Search by complete element name.
Meter_00*Match by element name prefix.
\California\San Diego\Select leaf elements under this exact parent path; the empty trailing name is equivalent to *.
\California\Meter_*Match leaf element names under the actual California parent path.
\California\San Diego\Meter_00?Specify a parent path and a trailing name pattern.

Every node in the parent path must exist exactly as specified. * and ? apply only to the final name pattern. \California\San Diego treats San Diego as an element name; if it is a grouping node, the result may be empty. Add a trailing \ to select leaf elements under that parent path.

2.2 path: wildcard matching of complete relative paths​

Choose path when wildcards are needed in parent path segments. It matches the complete path relative to the AF database root, without AF Server or AF Database prefixes, usually without a leading backslash. It returns only leaf elements.

For an actual path of California\San Diego\Meter_001, use California\*\Meter_00? to match it. * can span path separators and cannot restrict the match to an exact number of directory levels. A trailing \ is also part of the pattern; it is not expanded using the omitted-name rule for element.

warning

Path Filter Case Sensitive controls only path scan matching. It does not change Point, Template, or other runtime comparisons. An empty pattern may expand to all leaf elements. For first use, enter an approved, small scope.

3. Model downloads and automatic addition​

  1. Enter the filter and download the default configuration. Check the actual Points, elements, templates, and mappings, and confirm that they remain within the authorized scope.
  2. For a fixed single-column task, further trim the Point mappings and disable automatic addition. For AF multi-column mode, also review the template scope in the next section.
  3. Automatic addition replays the saved rules. Manually deleting rows from the initial CSV does not narrow subsequent discovery. Review both the rules and the model when changing scope.
  4. Point name rules can discover new Points. AF template scopes can include new PI Point attributes. Element or path rules without a template restriction can discover newly matching elements. Fixed lists or CSV files without replayable rules do not expand collection automatically.
  5. Process existing historical data for new objects separately with backfill. Deletions and type changes are not additions either. See PI historical backfill and real-time continuation.

Dataset filtering, model-block Filter expressions, and SQL query filtering after ingestion are three different mechanisms. They cannot replace one another.

4. Multi-column templates and collection scope​

Multi-column collection is organized by AF template by default, with ignore_template defaulting to false. After element or path matches a templated Meter_001, the downloaded model may generate a MeterTemplate definition. The production task searches for all instances of that template. Neither disabling automatic addition nor trimming the downloaded file limits the template instances included during initialization.

Collection requirementBefore submission
Collection of the entire template is permittedAsk the AF administrator to list all instances and attributes of MeterTemplate. Review the complete scope before starting.
Only specified elements are permittedUse element or path, keep ignore_template=true in both model generation and the production task, and model elements independently. Both stages must be consistent.
Filtering by templateDo not combine it with ignore_template=true. This combination is rejected and cannot produce a fixed element list within a template.

ignore_template is a DSN query parameter, not a standalone command-line flag. If the accompanying form does not expose this setting, first confirm an available method with delivery or support staff. Do not guess a flag name, modify files in use, or start collection in a restricted scope to see what happens. For elements without a template, also confirm that independent-element modeling matches the production collection configuration.

Verify scope with a separate test target. Ask the AF administrator to prepare two elements using the same template: the approved Meter_001 and the unapproved Meter_002. Confirm that new values or specified historical data for the first element are written correctly, and that no extra tables or writes are created for the second. Also check the complete target child-table list and source tags. If Meter_002 has already been collected, correct the configuration first, then handle the out-of-scope data through the approved process. Do not expand the backfill further.

5. Checking unexpected matches​

If no objects match, check the system and model, filter unit, parent path or complete relative path, trailing backslash, case, leaf-element scope, and read identity, in that order. After correcting the problem, download a small-scope model again. Do not expand directly to a database-wide * and start production collection.