2.2.4.5.13 Column::GetDistinctValues


Description

Get all the unique text entries of the column value.

Syntax

int GetDistinctValues( vector<string> & vsValuse, vector<uint> * pvCounts = NULL, BOOL bOnlyGetShownValues = FALSE )

Parameters

vsValuse
[output] all the unique text entries
pvCounts
[output] the frequency of the corresponding text entry
bOnlyGetShownValues
[input] if true, ignore hidden row

Return

value as COLDISTINCTVALUE

Examples

EX1

void GetDistinctValues_ex(int nCol)
{
    Worksheet wks = Project.ActiveLayer();    
    if ( wks )
    {
        Column col(wks, nCol);
        
        vector<string> vsValuse;
        vector<uint> vnCount;
        col.GetDistinctValues(vsValuse, &vnCount);
        int nSize = vsValuse.GetSize();
        for(int ii = 0; ii < nSize; ii++)
            out_int(vsValuse[ii]+"=", vnCount[ii]);
    }
}

Remark

See Also

Header to Included

origin.h