DeepSee MDX Reference
CREATE MEMBER Statement
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   
Search:    

Creates a calculated member that can be used within the current session.
Syntax and Details
CREATE SESSION MEMBER calc_mem_details, FORMAT_STRING='format_details',
SOLVE_ORDER=integer
Where calc_mem_details is as follows:
cube_name.[dimension_name].[new_member_name] AS 'value_expression'
And:
Also see Identifiers.”
When you use the MDX shell, a session is started; the session ends when you exit the shell. During this session, if you use the CREATE MEMBER statement, the member that you create is available until the session ends or until you use the DROP MEMBER statement.
Example
First, in the MDX shell, we define a new member in the Patients cube:
>>CREATE SESSION MEMBER patients.MEASURES.scoresquared AS 'MEASURES.[test score]*MEASURES.[test score]' 
 
---------------------------------------------------------------------------
Elapsed time:       .013701s
Then we use the new measure in a query:
>>SELECT MEASURES.scoresquared ON 0, aged.[age group].MEMBERS ON 1 FROM patients
                              scoresquared
1 0 to 29                    66,801,054,681
2 30 to 59                   61,070,271,376
3 60+                         9,120,632,004
---------------------------------------------------------------------------
Elapsed time:       .016856s
See Also