If you want unique values in a list or table column here are some functions that will help. The first one is for a list:
/*
Function Name: get_unique_values
Description: Find the unique values in a list. Uses an associative array
Arguments:
in_list List to get unique values for
*/
Get_unique_values = Function( {in_list},
{Default Local},
tmp = [=> 0];
Insert Into( tmp, in_list );
tmp << get keys;
);
For a table column:
/* Function Name Get_Unique_Values_col
Description: Get the unique values for a column. For example:
Indications
------------
AAAAA
BBBBB
AAAAA
CCCCC
CCCCC
unique_list = get_unique_values_col (:Indications)
will return {"AAAAA", "BBBBB", "CCCCC"}
Arguments:
dtcol column descriptor to calculate unique values for
*/
Get_Unique_Values_col = Function( {dtcol},{default local},
// Eval/expr trickery to get this to work.
eval(eval expr(
Summarize(unique_list = By(expr(dtcol)))));
unique_list;
);