locked
Session MDX scripts and assignments RRS feed

  • Question

  • In SSAS 2005 if a MDX script is saved in the default cube script it is possible to assign values to a specified set:

    SCOPE <set>;
    THIS = desired value;
    END SCOPE;

    In order to add/remove this assignment programmatically the script has to be injected in a cube using AMO.
    The assigments applied are visible to every user browsing the cube.

    I'm trying to obtain similar results using a session and ADOMD.NET.
    I would not like to update server objects until an assigment is saved by a user.
    I connect to a cube using:

    Data Source=localhost;Persist Security Info=False;Integrated Security=SSPI;Catalog=<database name>;Cube=<cube name>

    The Cube keyword in the connection string sets the <cube name> as current context.
    It is possible to assign values to a specified set using

    <set> = desired value;

    This assigment is persistent until the end of the session and only for the connected user,
    that is what I want to achieve.

    1) Is there a way to set a cube as current context without adding the Cube keyword in the connection string (e.g. somenthing like USE <DATABASE> in SQL) ?  
    1) Is there a way to remove the assigments previously made (an undo feature)?
     
     
    Thanks a lot,
     
    Stefano
    Thursday, May 18, 2006 9:24 AM

Answers

  • Hi Stefano,

    You can do this to create a session calculation:

    create cell calculation  <cube>.x for '(<set>)' as 'desired value'

    It's not the same as an assignment because:

    - assignments are made in the global scope, this is made in session scope

    - calculated cells do not automatically advance pass as assignments do

    You can later drop this in the session with the drop cell calculation statement

    And, sorry, we don't have a use database. <sigh>

     

    Cheers,

    Richard Tkachuk (richtk@microsoft.com)

    Thursday, May 18, 2006 6:19 PM

All replies

  • Hi Stefano,

    You can do this to create a session calculation:

    create cell calculation  <cube>.x for '(<set>)' as 'desired value'

    It's not the same as an assignment because:

    - assignments are made in the global scope, this is made in session scope

    - calculated cells do not automatically advance pass as assignments do

    You can later drop this in the session with the drop cell calculation statement

    And, sorry, we don't have a use database. <sigh>

     

    Cheers,

    Richard Tkachuk (richtk@microsoft.com)

    Thursday, May 18, 2006 6:19 PM
  • I'll try to use this suggestion.

    Thanks a lot.

    Stefano
    Friday, May 19, 2006 8:31 AM