MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum

 » Database Journal Home » Database Articles » Database Tutorials MS SQL Oracle DB2 MS Access MySQL » RESOURCES SQL Scripts & Samples Tips » Database Forum » Slideshows
 Database Journal |DBA Support |SQLCourse |SQLCourse2

## MS SQL

Posted Dec 8, 2003

# MDX Essentials: Basic Set Functions: The Intersect() Function

By William Pearson

This is the fourteenth article of the series, MDX Essentials. The series is designed to provide hands-on application of the fundamentals of the Multidimensional Expressions (MDX) language, with each tutorial progressively adding features designed to meet specific real-world needs.

For more information about the series in general, as well as the software and systems requirements needed for getting the most out of the lessons included, please see the first article, MDX at First Glance: Introduction to MDX Essentials.

Note: Service Pack 3 updates are assumed for MSSQL Server 2000, MSSQL Server 2000 Analysis Services, and the related Books Online and Samples.

### What We Accomplished in our Last Article

In the last article of the series, Basic Set Functions: The Union() Function, we explored the commonly used Union() function, whose purpose is to combine two sets into one. We discussed the function in general, along with the capabilities it affords us within MDX, emphasizing its value within our analysis toolsets.

In addition to discussing the purpose and operation of the Union() function, we examined both primary and alternate syntaxes involved in its use, illustrating the application of each in practice exercises. Focusing on the treatment of duplicates in each of the syntactical approaches, we discussed the results we obtained in each exercise, remarking on distinguishing characteristics of each.

### Introduction

In this lesson, we will focus our attention on a function that has some characteristics in common with the Union() function, yet produces a very different result. The rather simple purpose of the Intersect() function is to compare two sets, then to return a set that consists of members that exist in both original sets; that is, to return a mathematical set intersection of the sets specified in the function. Indirect uses of Intersect() are quite common, as well. Like the Union() function, the Intersect() function provides important capabilities within MDX, and is a valuable part of our analysis toolsets

Along with an introduction to the Intersect() function, this lesson will include:

• an examination of the syntax surrounding the function;
• illustrative examples of the uses of the function in practice exercises;
• a brief discussion of the MDX results we obtain in the practice examples.

MS SQL Archives

 Latest Forum Threads MS SQL Forum Topic By Replies Updated SQL 2005: SSIS: Error using SQL Server credentials poverty 3 August 17th, 07:43 AM Need help changing table contents nkawtg 1 August 17th, 03:02 AM SQL Server Memory confifuration bhosalenarayan 2 August 14th, 05:33 AM SQL Server – Primary Key and a Unique Key katty.jonh 2 July 25th, 10:36 AM