Skip to main content

MinString - script function

MinString() finds string values in the expression and returns the first text value sorted alphabetically over a number of records, as defined by a group by clause.

Syntax:  

MinString ( expr )

Return data type: dual

Arguments:  

Arguments
Argument Description
expr The expression or field containing the data to be measured.

Limitations:  

If no text value is found, NULL is returned.

Examples and results:  

Add the example script to your app and run it. To see the result, add the fields listed in the results column to a sheet in your app.

Resulting data
Example Result  

TeamData:

LOAD * inline [

SalesGroup|Team|Date|Amount

East|Gamma|01/05/2013|20000

East|Gamma|02/05/2013|20000

West|Zeta|01/06/2013|19000

East|Alpha|01/07/2013|25000

East|Delta|01/08/2013|14000

West|Epsilon|01/09/2013|17000

West|Eta|01/10/2013|14000

East|Beta|01/11/2013|20000

West|Theta|01/12/2013|23000

] (delimiter is '|');

 

Concat1:

LOAD SalesGroup,MinString(Team) as MinString1 Resident TeamData Group By SalesGroup;

SalesGroup

East

West

MinString1

Alpha

Epsilon

Given that the TeamData table is loaded as in the previous example, and your data load script has the SET statement:
SET DateFormat='DD/MM/YYYY';':

LOAD SalesGroup,MinString(Date) as MinString2 Resident TeamData Group By SalesGroup;

SalesGroup

East

West

MinString2

01/05/2013

01/06/2013

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!