Overview
TBIQuery combines the functionality of TDataSelect and TSummary into a single component:- Dimensions: Fields to select or group by
- Measures: Aggregated calculations (Sum, Count, Average, etc.)
- Filter: Data filtering conditions
- SortBy: Result ordering
Class Definition
Properties
Dimensions
Collection of fields to select or group by.Automatic: Let TeeBI decide the layoutRow: Place in rows (for summaries)Column: Place in columns (for summaries)
Measures
Collection of aggregated calculations.Count: Count of non-null valuesSum: Total sumAverage: Mean valueMinimum: Smallest valueMaximum: Largest valueFirst: First valueLast: Last value
Filter
Filtering conditions applied to the data.SortBy
Ordering of results.Distinct
Remove duplicate rows from results.MaxRows / StartRow
Pagination support.RemoveMissing
Control how missing (null) values are handled in summaries.Methods
Calculate
Executes the query and returns the result. Returns: TDataItem with query resultsParse
Parses SQL syntax and configures the query.Source data item
SQL query string
Optional error handler
Clear
Resets all query settings.ToString
Converts the query to SQL syntax. Returns: SQL string representationQuery Types
TBIQuery automatically determines the query type:SELECT Query
Created when there are no measures:SUMMARY Query
Created when there are one or more measures:Examples
Simple Selection
Aggregation by Single Dimension
Multi-Dimensional Aggregation
Date Part Grouping
Filtering
Sorting Results
Using Expressions
Pagination
Loading from SQL
Dimension and Measure Configuration
TQueryDimension Properties
TQueryMeasure Properties
See Also
- TBISQL - SQL parser and generator
- TSummary - Aggregation engine
- TDataSelect - Selection and filtering
- TExpression - Expression evaluation
