Best Practices: Letting SAS Enterprise Guide Write MDX Code

January 4, 2012
By

SAS Enterprise Guide is a VERY useful client tool for SAS development and data analysis.  One the best features is the ability to see the SAS code generated from different tasks.  In addition to viewing the Base SAS code used to perform different tasks, you can also view MDX code written to create certain measures, members, and sets in OLAP Cubes.

Adding Simple Measures from SAS Enterprise Guide

Let’s start by creating a simple measure for a Rolling 3 Months of Sales using my SGF2011 cube:

1 Best Practices: Letting SAS Enterprise Guide Write MDX Code

Create a time series measure:

2 Best Practices: Letting SAS Enterprise Guide Write MDX Code

Enter the parameters:

3 Best Practices: Letting SAS Enterprise Guide Write MDX Code

Specify the format:

41 Best Practices: Letting SAS Enterprise Guide Write MDX Code

The next screen summarizes the parameters entered into this wizard. You can see the MDX written here as well.  Click ‘Finish’ to define the measure.

You should see the measure in your cube output.  Right click anywhere on the grid output to ‘Edit View’ > ‘Edit with MDX Editor’.

5 Best Practices: Letting SAS Enterprise Guide Write MDX Code

This is the output you should see in the MDX Editor:

6 Best Practices: Letting SAS Enterprise Guide Write MDX Code

The measure can then be defined in the cube globally by putting the MDX code in the SAS program which builds the cube (if applicable) or through SAS OLAP Cube Studio.  This same method can be used to view the MDX code generated for custom members and sets.

On a more general note, if you want to learn MDX, you can use SAS Enterprise Guide to learn basic MDX syntax by manipulating a cube and viewing the MDX code generated.  If you need some help getting started with OLAP – in the To Write or not Write OLAP Code  post I talk more about writing OLAP cubes.

 Best Practices: Letting SAS Enterprise Guide Write MDX Code Steve Overton  (12 Posts)

Passionate about productivity, quality, strong leadership, and intelligent decisions. Expert in Business Intelligence and Data Warehousing solutions. Primarily work with SAS 9 Enterprise Business Intelligence platform. Loving life and enjoying working for Zencos Consulting (http://www.zencos.com). Enjoy the knowledge!

Website Best Practices: Letting SAS Enterprise Guide Write MDX CodeTwitter Best Practices: Letting SAS Enterprise Guide Write MDX CodeGoogle Plus Best Practices: Letting SAS Enterprise Guide Write MDX CodeLinkedin Best Practices: Letting SAS Enterprise Guide Write MDX Code

0saves
Show me some love! If you enjoyed this post, leave a comment or subscribe to the free RSS feed to have future articles delivered to your feed reader. I respect your privacy - your email will not be shared, sold, bartered, given away, written on a bathroom wall ...

Tags: , , ,

2 Responses to Best Practices: Letting SAS Enterprise Guide Write MDX Code

  1. [...] have described a trick you can use to let Enterprise Guide write the MDX code for you!  So rather than loose sleep over how to structure an MDX query, take the easier route and let SAS [...]

  2. [...] of the aggregate build process; using OLAP Cube Studio does not.  Another post of mine shows how to use Enterprise Guide to write MDX code, which can be used as [...]



Latest Tweets

Twitter

Archives

January 2012
M T W T F S S
« Dec   Feb »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

x
Loading...