Template:Distinct values

Usage
This template collects only the distinct values passed to it through the parameters and then passes those values to another template of your choice. After completion, this template leaves behind many trash variables with prefixes "" and a variable  that holds the number of unique values encountered.
 * prefix parameter marks a prefix that the selected parameters should have. Default prefix is . For example, if prefix is x, then all the values passed to this template should have parameter names starting with "x".  . This prefix should not be a prefix of the words "prefix", "temp_prefix", "template". Note that an empty prefix is a prefix of all.
 * temp_prefix parameter is a temporary prefix used for internal variables that this template uses to collect the distinct values. This prefix should be something unique and hard to find as a variable name elsewhere. Default prefix is
 * template parameter is the name of the template that you want the values propagated to. It is passed 3 parameters: is the same as the prefix given above.  is the ascending number of the value encountered. This number starts from 1 and increments by 1 for every new value.  is the value found. This template will be called for every unique value found. The result of this template will be the result from all the calls to the specified template.

This template is useful when used in DPL statements. Passing the results from DPL to parameters of this template and then doing something with the unique values. An example of a template that can be used to do something with the values is Template:Generate variable.

Examples

 * How to use this template in a DPL statement: