Posted By

venu1729 on 07/10/13


Tagged

ssas mdx


Versions (?)

Deploy MDX calculations with XMLA


 / Published in: XML
 

URL: http://www.purplefrogsystems.com/blog/2010/10/deploying-mdx-calculation-scripts-with-xmla/

The below script can be used to deploy calculated members directly onto a cube on a server, without having the solution, or deploying the entire cube.

Important Note : The script shud have definitions of existing calculated members too. If you don't put them in, they'll get deleted from the cube.

  1. <Alter
  2. AllowCreate="true"
  3. ObjectExpansion="ExpandFull"
  4. xmlns="http://schemas.microsoft.com/analysisservices/2003/engine"
  5. xmlns:as="http://schemas.microsoft.com/analysisservices/2003/engine">
  6. <Object>
  7. <DatabaseID>YourDatabaseName</DatabaseID>
  8. <CubeID>YourCubeName</CubeID>
  9. <MdxScriptID>MdxScript</MdxScriptID>
  10. </Object>
  11. <ObjectDefinition>
  12. <MdxScript>
  13. <ID>MdxScript</ID>
  14. <Name>MdxScript</Name>
  15. <Commands
  16. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  17. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  18. xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"
  19. xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"
  20. xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100"
  21. xmlns:dwd="http://schemas.microsoft.com/DataWarehouse/Designer/1.0">
  22. <Command>
  23. <Text>
  24. /*
  25. The CALCULATE command controls the aggregation of leaf cells in the cube.
  26. If the CALCULATE command is deleted or modified, the data within the cube is affected.
  27. You should edit this command only if you manually specify how the cube is aggregated.
  28. */
  29. CALCULATE;
  30.  
  31. ------------------------------------------------
  32. --Paste your MDX Calculations here
  33. ------------------------------------------------
  34. -- Eg. Syntax: create member [CurrentCube].[Measures].[MyMedian] as Median(set, measure) ;
  35.  
  36. </Text>
  37. </Command>
  38. </Commands>
  39. </MdxScript>
  40. </ObjectDefinition>
  41. </Alter>

Report this snippet  

You need to login to post a comment.