Function: primary_choice

Function: primary_choice

Usage

 primary_choice(some_choice_value)

Returns the name of the 'top level' choice selected.

For example if a choice field is declared with the choices:

choice:
	name: large
	choice: red
	choice: blue
choice:
	name: small
	group choice: just small
	choice: green
	choice: yellow

Then primary_choice("large red") == "large".

This function is used to keep statistics cleaner by not having columns for all possible sub choices.

Parameters

Parameter Type Description
input string Choice value to look at.

Examples

 primary_choice("large red")    ==  "large"
 primary_choice("large")        ==  "large"
 primary_choice("small green")  ==  "small"