[]
        
(Showing Draft Content)

C1.PivotEngine.C1PivotEngine.GetUniqueValues

GetUniqueValues Method

GetUniqueValues(string, string, Dictionary<string, object>, string, CancellationToken)

Lists unique values of a field for the server's clients.

Declaration
public static Task<IList> GetUniqueValues(string workspace, string table, Dictionary<string, object> view, string fieldName, CancellationToken cancelToken)
Parameters
Type Name Description
string workspace

Path in the server's file system where DataEngine data is saved in files.

string table

The name of a DataEngine table.

Dictionary<string, object> view

View definition used for performing aggregation.

string fieldName

The name of the field to provide unique values for.

CancellationToken cancelToken

Enables task cancellation.

Returns
Type Description
Task<IList>

Collection of objects with properties Name (string) and Type (System.Type)

Remarks

Using this method, a client can show a list of values for the user to choose from.

Specifying the view (and not just a field name) for which values are to be listed is necessary because list of values can depend on the field's format (for example, values can be rounded).

Clients need to be aware that getting value list can take considerable time if number of rows in the source data is very large.

GetUniqueValues(IEnumerable, Dictionary<string, object>, string, CancellationToken)

Lists unique values of a field for the server's clients.

Declaration
public static Task<IList> GetUniqueValues(IEnumerable dataSource, Dictionary<string, object> view, string fieldName, CancellationToken cancelToken)
Parameters
Type Name Description
IEnumerable dataSource

Data source collection.

Dictionary<string, object> view

View definition used for performing aggregation.

string fieldName

The name of the field to provide unique values for.

CancellationToken cancelToken

Enables task cancellation.

Returns
Type Description
Task<IList>

Collection of objects with properties Name (string) and Type (System.Type)

Remarks

Using this method, a client can show a list of values for the user to choose from.

Specifying the view (and not just a field name) for which values are to be listed is necessary because list of values can depend on the field's format (for example, values can be rounded).

Clients need to be aware that getting value list can take considerable time if number of rows in the source data is very large.

GetUniqueValues(PivotField, out Exception, int, int)

Gets a list of unique values from a PivotField.

Declaration
public List<object> GetUniqueValues(PivotField field, out Exception ex, int dataLimit = 1000000000, int uniqueLimit = 1000)
Parameters
Type Name Description
PivotField field

A PivotField that contains values.

Exception ex

An Exception occurs in the operation.

int dataLimit

Limit of data values.

int uniqueLimit

Limit of unique values.

Returns
Type Description
List<object>

A list of unique values.