Switch to script mode to build custom members in the integrated development environment (IDE). To do this, click the Script Mode button from the Custom Member designer.
Once in script mode, build your custom formula by adding the required functions, hierarchies, and elements, or simply type your formula. If using an MS OLAP or Tabular model, write your formula in MDX; if using an SQL data model, write your formula in PQL.
Follow the example bellow to learn how to build an aggregate custom member:
Open the Numeric functions, and drop the Aggregate formula into the scripting window.
Replace <set definition> with All Members from the Member functions.
Aggregate(AllMembers(<model attribute uniqueName>))
Replace <model attribute uniqueName> with the required hierarchy from the Hierarchies panel.
Test the script, and save it to the CMS. Click Quick Discovery to open the custom member in Discover immediately.