CategoricalData::Map

ClassName

CategoricalData

AccessType

public

Name

Map

Declaration

CategoricalMap Map

Remark

Examples

EX1

void CategoricalData_Map_ex1()
{
    Worksheet wks;
    wks.Create();
    if (wks)
    { 
        Dataset    ds(wks, 0);
        ds.SetSize(8);
        vector<string> vs = {    "aaa","bbb","ddd","ccc"};
        ds.PutStringArray(vs);

        string strWksColname = wks.Columns(0).GetName();
        strWksColname = wks.GetPage().GetName() + "_" + strWksColname;    
        
        StringArray vMyCatMap;
        CategoricalData cdMyCatData(strWksColname);
        vMyCatMap = (StringArray) cdMyCatData.Map; // CategoricalMap is sorted in ascending order by default
        cdMyCatData.Map.ArrangeZA();               // Sort CategoricalMap in descending order
        vMyCatMap = (StringArray) cdMyCatData.Map;
        cdMyCatData.Map.ArrangeAZ();               // Sort CategoricalMap in ascending order
        vMyCatMap = (StringArray) cdMyCatData.Map;
    }
}

Description

The text value to index map for this CategoricalData data set. See the CategoricalMap class for more details.

header to Include

origin.h

See Also

Reference