AFAggregate.FrequencyDistributionAsync(T) Method
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Generates a frequency distribution for the specified items asynchronously.
Namespace: OSIsoft.AF.Data.Aggregate
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static Task<AFGroupedResult<Object>> FrequencyDistributionAsync<T>( this IEnumerable<T> items, string groupedField, CancellationToken cancellationToken ) where T : AFObject
<ExtensionAttribute> Public Shared Function FrequencyDistributionAsync(Of T As AFObject) ( items As IEnumerable(Of T), groupedField As String, cancellationToken As CancellationToken ) As Task(Of AFGroupedResult(Of Object)) Dim items As IEnumerable(Of T) Dim groupedField As String Dim cancellationToken As CancellationToken Dim returnValue As Task(Of AFGroupedResult(Of Object)) returnValue = items.FrequencyDistributionAsync(groupedField, cancellationToken)
public: [ExtensionAttribute] generic<typename T> where T : AFObject static Task<AFGroupedResult<Object^>^>^ FrequencyDistributionAsync( IEnumerable<T>^ items, String^ groupedField, CancellationToken cancellationToken )
[<ExtensionAttribute>] static member FrequencyDistributionAsync : items : IEnumerable<'T> * groupedField : string * cancellationToken : CancellationToken -> Task<AFGroupedResult<Object>> when 'T : AFObject
Parameters
- items
- Type: System.Collections.GenericIEnumerableT
The items that should be summarized. - groupedField
- Type: SystemString
The field whose value should be grouped. - cancellationToken
- Type: System.ThreadingCancellationToken
A token to control cancellation of the aggregation request.
Type Parameters
- T
- The type of items to summarize
Return Value
Type: TaskAFGroupedResultObjectA result containing the requested frequency distribution or an error if the summaries could not be performed.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
| This call might use a background task to complete some of its work. See the Threading Overview for some matters to consider when execution transitions to another thread. |