0

Is there any way to get a list of partitions inside a MeasuresGroup ? And how can I process them with specific conditions on there name ?

Thanks for your help.

Hamza Lahbabi
  • 29
  • 1
  • 9

1 Answers1

0
  • SSAS Tabular is organized in JSON format (pretty easy to read, just open the model.bim file and you will pretty fast get what you want, but as you are talking about Measuregroups you are in the word of Multidimensional cubes.)
  • SSAS Multidimensional is organized in XML format (I can recommend to analyze the structure of the XMLA-File of the cube to get a better understanding of the structure of SSAS MD. If you want to get your list manually this would be the way to go). How to get the XMLA-File?
    • Open your Cube Server in SSMS
    • Expand your Cube, Expand "Cubes", right click on your Cube >> "Script cube as" >> "Create To" >> "File"
    • Open the File with a XML Viewer. I can recommend MindFusion XML Viewer as it opens the overwhelming big XML file completely collapsed, which gives you the chance to better understand the structure

XMLA-File will look something like this and you can browse into the Partitions manually and search for your information:

enter image description here

As you were asking to something more flexible, what I can reccomend you is to use the AMO-library, which allows you to browse the exact XMLA-File directly on the server. Either via PowerShell or via C#. How? DatabaseJournal.com has a very straight forward guideline on how to script dimensions with AMO. In the same fashion information about Measure Groups can be accessed. If you are interested on how to use Powershell with AMO to get a list of all the Partitions inside a Measure Group, give me a thumbs up - I can guide you a bit, but I'll leave it for now as I already spent half an hour writing this answer :-).

Mathias Fogel
  • 306
  • 2
  • 5