Skip to main content

%NOT (MDX)

Enables you to exclude a single member of a given level. This function is an InterSystems extension to MDX.

Returned Type

This function returns a member.

Syntax and Details

member_expression.%NOT

Where:

  • member_expression is a member identifier. (Note that you cannot use a general member expression.)

This function enables you to exclude the given member.

Example

Often it is necessary for the WHERE clause to exclude a single member. For example, first consider the following query, which uses EXCEPT:

SELECT aged.[age bucket].MEMBERS ON 1 FROM patients WHERE EXCEPT(aged.[age group].MEMBERS,aged.[age group].[0 to 29])
 
1 0 to 9                                  *
2 10 to 19                                *
3 20 to 29                                *
4 30 to 39                              166
5 40 to 49                              139
6 50 to 59                              106
7 60 to 69                               86
8 70 to 79                               62
9 80+                                    41

You can use the %NOT function to rewrite the previous query as follows:

SELECT aged.[age bucket].MEMBERS ON 1 FROM patients WHERE aged.[age group].[0 to 29].%NOT
 
 1 0 to 9                                  *
2 10 to 19                                *
3 20 to 29                                *
4 30 to 39                              166
5 40 to 49                              139
6 50 to 59                              106
7 60 to 69                               86
8 70 to 79                               62
9 80+                                    41

If you use this function on the column or row axis, you can see that it returns a member:

SELECT aged.[age group].[0 to 29].%NOT ON 1 FROM patients
 
Not 0 to 29                             600

As you can see the name of the member is NOT followed by the name of the excluded member.

The %NOT function provides several advantages:

  • The system does not need to materialize all the members of the level.

  • The negation occurs in an earlier part of the processing for greater efficiency.

  • %NOT returns a single member which can be combined (internally) with other filters to form simple tuple expressions.

See Also

Purpose of this instance: Draft documentation
DocReleaseID: HealthConnect2025.1
Content loaded from:
/staging/learning/iris-doc/2025.1.x/doc/cache/en-us/src/
/staging/learning/iris-doc/2025.1.x/doc/ensemble/en-us/src/
/staging/learning/iris-doc/2025.1.x/doc/healthconnect/en-us/src/
/staging/learning/iris-doc/2025.1.x/doc/healthcommon/en-us/src/
/staging/learning/iris-doc/2025.1.x/doc/security/en-us/src/
Excluded items: AADAN, ABIT, ACLOUD, AFL_adonet, AFL_ecp, AFL_icm, AFL_jdbc, AFL_netxep, AFL_sharding, AFL_xep, APMML, APOWER, ARGATEWAY, AWEBSOCKETS, AWSGI, BJAVA, BJAVNAT, BJAVPER, BJAVXEP, BJSNAT, BNET, BNETNAT, BNETODBC, BNETXEP, BPYNAT, BSPK, BTPI, BXCI, GAUTOML, GCONV, GCSP, GICM, GIKNOW, GIML, GISQ, GISR, GSCF, GSQLSRCH, GTSQ, GUIMA, PAGE_activex, PAGE_administration, PAGE_apimgr, PAGE_appdev_ides, PAGE_bi, PAGE_cachedirect, PAGE_data_migration, PAGE_data_science, PAGE_deployment, PAGE_deployment_configuration, PAGE_deployment_containers, PAGE_deployment_icm, PAGE_deployment_iko, PAGE_deployment_install, PAGE_dotnet, PAGE_dotnet_native, PAGE_dsvr, PAGE_embedded_language_development, PAGE_epython, PAGE_external_language_development, PAGE_interop, PAGE_interop_lifecycle, PAGE_interop_vdoc, PAGE_interoperability, PAGE_java, PAGE_java_jdbc, PAGE_java_native, PAGE_machine_learning, PAGE_monitoring, PAGE_multimodel, PAGE_multimodel_multidimensional, PAGE_multimodel_object, PAGE_multivalue, PAGE_native, PAGE_nodejs_native, PAGE_objectscript, PAGE_objectscript_ides, PAGE_odbc, PAGE_platform_arch_design, PAGE_pygate, PAGE_python, PAGE_python_native, PAGE_reports, PAGE_scalability, PAGE_security_authentication, PAGE_security_authorization, PAGE_studio, PAGE_zen, PAGE_zenmojo, PAGE_zenreports
FeedbackOpens in a new tab