InterSystems IRIS Data Platform 2019.2  /  InterSystems MDX Reference

InterSystems MDX Reference
Previous section           Next section
InterSystems: The power behind what matters   

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'
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.
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
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

Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-08-16 05:39:10