TOC : Script API > JavaScript > JavaScript API > Component > Band > DataSubBand > Method >

 

GetDataSetMAX

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

TOC : Script API > JavaScript > JavaScript API > Component > Band > DataSubBand > Method >

 

GetDataSetMAX

 

 

Gets the maximum value from the given field.

 

 

 

Prototype :

 

double GetDataSetMAX

(

        string FieldPath

        [ string DistinctFieldName ],

        [ string ConditionFieldName ]

)

 

 

 

Arguments :

 

FieldPath

Field Path setup depends on the field type

DistinctFieldName

Field name for deduplication

ConditionFieldName

Field name for search condition

 

 

 

Reference :

 

Refer to GetDataSetValue function for how to set the field path.

 

Refer to GetDataSetSUM function for using DistinctFieldName and ConditionFieldName.

 

If set FieldPath using dataset of the data sub band itself, GetDataSetMAX will return the same value as its parent band case. The parent bands of a data sub band are the data band or group header/footer band. Therefore, refer to the GetDataSetMAX function of the data band or group header/footer band.

 

 

 

Example :

 

//Data field (ODI name : Sample, dataset name : Orders, field name : Price)

 _TraceLn(This.GetDataSetMAX("Sample.Orders.Price"));

 

//Data field (ODI name and dataset name can be omitted)

 _TraceLn(This.GetDataSetMAX("Orders.Price")); //omit ODI name

 _TraceLn(This.GetDataSetMAX("Price")); //omit ODI name and dataset name

 

//ODI parameter field (ODI name : Sample, ODI parameter field name : TotalAmount)

 _TraceLn(This.GetDataSetMAX("Sample.OZParam.TotalAmount"));

 

//ODI parameter field (ODI name can be omitted)

 _TraceLn(This.GetDataSetMAX("OZParam.TotalAmount"));

 

//Data field (specify DistinctFieldName)

  _TraceLn(This.GetDataSetMAX("Price", "Region"));

 

//Data field (specify ConditionFieldName)

  _TraceLn(This.GetDataSetMAX("Price", "", "Flag"));

 

//Data field (specify DistinctFieldName and ConditionFieldName)

  _TraceLn(This.GetDataSetMAX("Price", "Region", "Flag"));

 

 

 

Available Events :

 

OnBind,  OnStartBind

 

 

 

See also :

 

GetDataSetSUM, GetDataSetValue