This function is used to arrange
the members of a set in their natural order. For example, observe the order of the
members in “Order method type” level.
The natural order of the members
is: Fax, Telephone, Mail, E-mail, Web, Sales visit, Special.
Let’s create a simple report using
Hierarchize function.
Syntax:
Hierarchize (set_exp)
or
Hierarchize (set (members))
or
Hierarchize (level)
Steps:
1. Take
a list and insert Order method type level.
2. Run
the report.
3. Delete
the Order method type column and insert a Query Calculation with below expression.
Hierarchize (set
([Web],[Telephone],[Special],[E-mail],[Fax],[Mail],[Sales visit]))
4. Run
the report.
In the above example, though we
created a set of members with irregular order, they are sorted in the natural order
in the output.
5. Change
the expression as follows.
Hierarchize (set
([Web],[Telephone],[Special],[E-mail],[Fax],[Mail],[Sales visit]), post)
6. Run
the report.
Now, the order is reversed.