From the Custom List designer, click the Script Mode button to the build custom lists in the integrated development environment (IDE). To build your custom list, add the required functions, hierarchies, and elements, or simply type your formula. The script language is PQL, unless working with an MS OLAP or Tabular model, in which case the script language is MDX.
Follow the example below to learn how to build a custom set that sorts its members in ascending order:
Open the Set functions, and drag the Order script onto the script window.
Test the script and save it to the CMS.