docs.intersystems.com
Home / InterSystems MDX Reference / MDX Functions / SUBSET

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


Returns a set of elements from a given set, by position. The first member is at position 0.
Returned Type
This function returns a set.
Syntax and Details
SUBSET(set_expression, first_element_position, optional_element_count)
Where:
Example
SELECT MEASURES.[%COUNT] ON 0, SUBSET(homed.city.MEMBERS, 0, 3) ON 1 FROM patients

                             Patient Count
1 Cedar Falls                         1,188
2 Centerville                         1,155
3 Cypress                             1,221
In contrast, consider this example, which shows the complete set:
SELECT MEASURES.[%COUNT] ON 0, homed.city.MEMBERS ON 1 FROM patients

                             Patient Count
1 Cedar Falls                         1,188
2 Centerville                         1,155
3 Cypress                             1,221
4 Elm Heights                         1,266
5 Juniper                             1,197
6 Magnolia                            1,156
7 Pine                                1,139
8 Redwood                             1,144
9 Spruce                              1,135


Previous section           Next section
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-04-10 14:45:56