Get Category

<< Click to Display Table of Contents >>

Navigation:  Defining a Model > Actions >

Get Category

Previous pageReturn to chapter overviewNext page

 

Get Category is a function that can only be used in Actions.  It sets the text value of an attribute based on the value of a variable.  

 

Categorizing Values for Attributes

 

GetCategory(collection reference, variable) 

Sorts collection by variable. Generates a list of the collection, then looks up those that match the parameters set by the variable. Returns all of these values.

 

GetCategory is the most efficient method for processing a list of variables. This function can only be used in an Action, and to use it you'll need to have a collection already created which you reference via the collection entity name (as it appears in the Model Overview), and the variable by which you're assigning categorical values.

 

The collection reference should point to a special entitytype containing the desired categorization. This entity must contain an attribute, "Category Name" and a numerical variable, "Category Level":

getCategoryVariables1

 

You can make the Category Name the key to the entitytype to reduce clutter, though this is not required, and may be an obstacle if you'd like to assign different values to the same category.

 

Once you have defined the entitytype, you can use initialization data to set the category levels. The Category Level is the lower bound for each Category Name:

 

getCategoryData1

 

Once you have created the entitytype containing the categories, you can use it in a GetCategory call in an action. Here, a Process List action iterates over the Person[] collection and assigns a level from the Quintile entitytype to each:

 

getCategoryAction1