dbTalk Databases Forums  

AMO Questions:MdxScript ,Command and CalculationProperty

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss AMO Questions:MdxScript ,Command and CalculationProperty in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
msnews.microsoft.com
 
Posts: n/a

Default AMO Questions:MdxScript ,Command and CalculationProperty - 10-28-2005 , 02:27 AM






Hi,
In Aanalysis server 2005,we can use AMO classes to manager
database,cube,dimension etc.But I cann't find how to add named set and
caculated member by amo.I read the help,find MdxScript class can do it. Do
anyone know how to add named set and caculated member by MdxScript,thanks.



Reply With Quote
  #2  
Old   
Adrian Dumitrascu
 
Posts: n/a

Default RE: AMO Questions:MdxScript ,Command and CalculationProperty - 10-28-2005 , 01:40 PM






The MdxScript class contains a collection of Command objects; in a Command
you can put an MDX statement to create a named set or a calculated member (in
the Text property).

Also, you can try this:
- use the cube editor from "SQL Server Business Intelligence Development
Studio" to create named sets or calculated members (in the "Calculations" tab)
- save the cube and view the XML file (right click on the cube item and use
"View Code")
- in the XML look for the <MdxScript> element in which you will see the
<Command> and the <Text> property for sample MDX code to put in AMO
- please note that the XML elements have direct correspondence in the AMO
classes and properties (for example the <MdxScript> element containing the
<Commands> element in which there is a <Command> means in AMO: the MdxScript
object with Commands property containing Command objects)
- you can use this "View Code" option to see how to setup other things in
AMO as the editors are doing

Adrian Dumitrascu.

"msnews.microsoft.com" wrote:

Quote:
Hi,
In Aanalysis server 2005,we can use AMO classes to manager
database,cube,dimension etc.But I cann't find how to add named set and
caculated member by amo.I read the help,find MdxScript class can do it. Do
anyone know how to add named set and caculated member by MdxScript,thanks.




Reply With Quote
  #3  
Old   
keo
 
Posts: n/a

Default Re: AMO Questions:MdxScript ,Command and CalculationProperty - 10-29-2005 , 09:00 PM



Thanks Adrian's reply
I try it,and find somthing understand.
1.I check sample database "Adventure Works DW" by BI Studio.In the cube's
caculate tab,I found MdxScript has only one command which hold many named
set and caculated member,and command object hasn't any property and function
to manager it.It is only Text property to get all the named set and
caculated member. can I add a named set in one command object then command
text is the named set's Mdx Command.
2.What's CalculationProperty? must I set the CalculationProperty when i
add named set and caculated member? How to get added named set 's command by
CalculationProperty's CalculationReference property?
3.What's the best solution in Cube's Caculation define? Cube has only
one MdxScript, and every Command hold only one caculation difine?
Thanks again!
"Adrian Dumitrascu" <Adrian Dumitrascu (AT) discussions (DOT) microsoft.com>
news:20D32B9B-92B9-4106-8726-63FCD5C4144C (AT) microsoft (DOT) com...
Quote:
The MdxScript class contains a collection of Command objects; in a Command
you can put an MDX statement to create a named set or a calculated member
(in
the Text property).

Also, you can try this:
- use the cube editor from "SQL Server Business Intelligence Development
Studio" to create named sets or calculated members (in the "Calculations"
tab)
- save the cube and view the XML file (right click on the cube item and
use
"View Code")
- in the XML look for the <MdxScript> element in which you will see the
Command> and the <Text> property for sample MDX code to put in AMO
- please note that the XML elements have direct correspondence in the AMO
classes and properties (for example the <MdxScript> element containing the
Commands> element in which there is a <Command> means in AMO: the
MdxScript
object with Commands property containing Command objects)
- you can use this "View Code" option to see how to setup other things in
AMO as the editors are doing

Adrian Dumitrascu.

"msnews.microsoft.com" wrote:

Hi,
In Aanalysis server 2005,we can use AMO classes to manager
database,cube,dimension etc.But I cann't find how to add named set and
caculated member by amo.I read the help,find MdxScript class can do it.
Do
anyone know how to add named set and caculated member by
MdxScript,thanks.






Reply With Quote
  #4  
Old   
Adrian Dumitrascu
 
Posts: n/a

Default Re: AMO Questions:MdxScript ,Command and CalculationProperty - 11-01-2005 , 01:02 PM



Quote:
1.I check sample database "Adventure Works DW" by BI Studio.In the cube's
caculate tab,I found MdxScript has only one command which hold many named
set and caculated member,and command object hasn't any property and function
to manager it.It is only Text property to get all the named set and
caculated member. can I add a named set in one command object then command
text is the named set's Mdx Command.
The BI Studio is indeed creating one Command object containing all the MDX
statements, but it's the same if you create with AMO multiple Command
objects, each with an MDX statement. There is no performance penalty either
way.
Important is to have the CALCULATE statement as the first one (in a separate
Command object or not), BI Studio documents it as:
"The CALCULATE command controls the aggregation of leaf cells in the cube.
If the CALCULATE command is deleted or modified, the data within the cube is
affected.
You should edit this command only if you manually specify how the cube is
aggregated."

The Command object indeed doesn't have other properties (except Text) to
set, not methods for administering it. Because the major object is the
MdxScript (who contains multiple Commands) who can be create/updated on the
server with the .Update method (or removed with .Drop).

Quote:
2.What's CalculationProperty? must I set the CalculationProperty when i
add named set and caculated member?
CalculationProperty is optional and you can use it to specify additional
settings (like formatting, translations) for a calculation defined in a
Command object.

Quote:
How to get added named set 's command by
CalculationProperty's CalculationReference property?
The CalculationReference specifies the name used in the creation of the
member, set or calc cell. Unmatched references are ignored.
For example: if you have a calculated member ABC (defined in a Command
object with the MDX statement CREATE MEMBER CURRENTCUBE.[MEASURES].ABC AS
1, you can create an associated CalculationProperty with
CalculationReference = ABC.

Quote:
3.What's the best solution in Cube's Caculation define? Cube has only
one MdxScript, and every Command hold only one caculation difine?
Cube has one MdxScript containing either multiple Commands (for each
calculation) or one Command (containing all the MDX statements concatenated).
There is no performance penalty between the 2 options, it's just a matter or
preference.

Adrian Dumitrascu.

"keo" wrote:

Quote:
Thanks Adrian's reply
I try it,and find somthing understand.
1.I check sample database "Adventure Works DW" by BI Studio.In the cube's
caculate tab,I found MdxScript has only one command which hold many named
set and caculated member,and command object hasn't any property and function
to manager it.It is only Text property to get all the named set and
caculated member. can I add a named set in one command object then command
text is the named set's Mdx Command.
2.What's CalculationProperty? must I set the CalculationProperty when i
add named set and caculated member? How to get added named set 's command by
CalculationProperty's CalculationReference property?
3.What's the best solution in Cube's Caculation define? Cube has only
one MdxScript, and every Command hold only one caculation difine?
Thanks again!
"Adrian Dumitrascu" <Adrian Dumitrascu (AT) discussions (DOT) microsoft.com
news:20D32B9B-92B9-4106-8726-63FCD5C4144C (AT) microsoft (DOT) com...
The MdxScript class contains a collection of Command objects; in a Command
you can put an MDX statement to create a named set or a calculated member
(in
the Text property).

Also, you can try this:
- use the cube editor from "SQL Server Business Intelligence Development
Studio" to create named sets or calculated members (in the "Calculations"
tab)
- save the cube and view the XML file (right click on the cube item and
use
"View Code")
- in the XML look for the <MdxScript> element in which you will see the
Command> and the <Text> property for sample MDX code to put in AMO
- please note that the XML elements have direct correspondence in the AMO
classes and properties (for example the <MdxScript> element containing the
Commands> element in which there is a <Command> means in AMO: the
MdxScript
object with Commands property containing Command objects)
- you can use this "View Code" option to see how to setup other things in
AMO as the editors are doing

Adrian Dumitrascu.

"msnews.microsoft.com" wrote:

Hi,
In Aanalysis server 2005,we can use AMO classes to manager
database,cube,dimension etc.But I cann't find how to add named set and
caculated member by amo.I read the help,find MdxScript class can do it.
Do
anyone know how to add named set and caculated member by
MdxScript,thanks.







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.