AFAggregate.FrequencyDistributionAsync(T) Method
- Last UpdatedSep 18, 2024
- PI System
- AF SDK 2024
- 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.0.1156
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.Generic.IEnumerable<T>
The items that should be summarized. - groupedField
- Type: System.String
The field whose value should be grouped. - cancellationToken
- Type: System.Threading.CancellationToken
A token to control cancellation of the aggregation request.
Type Parameters
- T
- The type of items to summarize
Return Value
Type: Task<AFGroupedResult<Object>>A 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 IEnumerable<T>. 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. |