Define Assignments and Other Script Commands
Applies To: SQL Server 2016
On the Calculations tab of Cube Designer, click the New ScriptCommand icon on the toolbar to create an empty script. When you create a new script, it initially is displayed with a blank title in the Script Organizer pane of the Calculations tab. The characters you type in the Calculation Expressions pane will be visible as the name of the item in Script Organizer. Therefore, you may want to type a commented name on the first line to more easily identify the script in the Script Organizer pane. For more information, see Introduction to MDX Scripting in Microsoft SQL Server 2005. For more information about performance issues related to MDX queries and calculations, see the section “Writing Efficient MDX” in the SQL Server 2005 Analysis Services Performance Guide.
You can use the Calculation Expressions pane to build an expression in Multidimensional Expressions (MDX) syntax. While you build the expression, you can drag or copy cube components, functions, and templates from the Calculation Tools pane to the Calculation Expressions pane. Doing so adds the script for the item to the Calculation Expressions pane in the location that you drop or paste it. Replace arguments and their delimiters (« and ») with the appropriate values.