mdx中元组和集之间的区别

时间:2021-10-26 03:29:10

What is the difference between tuple and set in MDX. How we can distinguish both and when we are using them.

MDX中元组和集之间有什么区别。我们如何区分这两者以及何时使用它们。

4 个解决方案

#1


12  

A tuple is a single hierarchy member taken from all the dimensions. Suppose Time.[2nd half] is a tuple of time dimension. At the same way we can have multiple tuples and we represent them in '(',')' brackets. Eg:

元组是从所有维度中获取的单个层次结构成员。假设时间。[下半部分]是时间维度的元组。同样,我们可以有多个元组,我们用'(',')'括号表示它们。例如:

(Time.[2nd half], Color.Dark.Red).

This is nothing but the mathematical intersection of nodes. we can represent the nodes in maths as (2,1) in the same way above expression will work.

这只不过是节点的数学交集。我们可以将数学中的节点表示为(2,1),就像上面的表达式一样。

Now coming to sets it is nothing but the composition of tuples. set contains one or more tuples it may zero also. we represent them in { , } braces. Eg:

现在开始设置它只不过是元组的组成。 set包含一个或多个元组,它也可能为零。我们用{,}括号代表它们。例如:

{ (Time.[1st half], Color.Dark.Red), (Time.[2nd half], Color.Dark.Blue) }

#2


13  

Having come to MDX from a more maths perspective this is my take on the question:

从更多的数学角度来看MDX,这是我对这个问题的看法:

Imagine you have 3d Cube with dimensions X, Y and Z. The number of cells in the cube is number of members in X multiplied by the number of members of Y multiplied by the number of members of Z.

想象一下你有三维立方体,尺寸为X,Y和Z.立方体中的单元格数是X中的成员数乘以Y的成员数乘以Z的成员数。

Each cell with have a coordinate in the cube based on a value from X, Y and Z. That coordinate is a Tuple.

每个单元格在立方体中具有基于X,Y和Z的值的坐标。该坐标是元组。

So lets say :

所以我们说:

  • X is Measures,
  • X是措施,
  • Y is Years,
  • Y是年,
  • Z is Products,
  • Z是产品,

Then a single cell could be the laptop sales for 1999. The cell coordinate will be: logically (X, Y, Z) and physically this is a tuple such as

然后单个单元格可能是1999年的笔记本电脑销售。单元格坐标将是:逻辑上(X,Y,Z)并且物理上这是一个元组,如

(Measures.Sales, Years.[1999], Products.[Laptop])  

Now lets say we want multiple cells, then we need multiple tuples, right? Yes, a Set is basically multiple tuples. Actually by multiple I include 0 and 1. So extending our example, we could have laptops from 1999 and desktops from 2001:

现在假设我们想要多个单元格,那么我们需要多个元组,对吗?是的,一个Set基本上是多个元组。实际上,通过多个我包括0和1.因此扩展我们的例子,我们可以拥有1999年的笔记本电脑和2001年的台式机:

{ 
    (Measures.Sales, Years.[1999], Products.[Laptop]) ,
    (Measures.Sales, Years.[2001], Products.[Desktop]) 
}

So you can see that you end up with multiple items with a set, and a single item with a tuple......

所以你可以看到你最终得到了一个带有一个集合的多个项目,以及一个带有元组的单个项目......

#3


5  

This article describes the terms Member, Tuple and Set in details.

本文详细介绍了Member,Tuple和Set这两个术语。

I'll try to explain it in an easy way.

我会尝试以简单的方式解释它。

Simply put, a tuple is an atomic slice of data in a dimension and a set is a collection of tuples. For example, you can have a Books dimension with tuples Sherlock Holmes, Tom Sawyer, CLR via C#, Code Complete and Quantum Physics for Dummies.
After that, you can organize these tuples into named sets, like Programming, Fiction and Natural Sciences.

简单地说,元组是维度中的原子数据片段,集合是元组的集合。例如,您可以使用元组Sherlock Holmes,Tom Sawyer,CLR通过C#,Code Complete和Quantum Physics for Dummies创建书籍维度。之后,您可以将这些元组组织成命名集,如编程,小说和自然科学。

[Books].&[Sherlock Holmes]                          -- Tuple
[Books].&[CLR via C#]                               -- Tuple
{ [Books].&[CLR via C#], [Books].&[Code Complete] } -- Set

There are certain functions in MDX that return sets or tuples, and it's often helpful to know how to convert a tuple to a set and vice versa. For example, the Item(...) function takes a specific tuple from a set. Enclosing multiple tuples in { , , } will create a set with these tuples.

MDX中有某些函数返回集合或元组,知道如何将元组转换为集合通常很有用,反之亦然。例如,Item(...)函数从集合中获取特定元组。在{,,}中包含多个元组将创建一个包含这些元组的集合。

The example I described is pretty partial and doesn't cover the whole theory, but it might give you a good basic understanding of how these concepts work.

我描述的例子非常局部,并不涵盖整个理论,但它可能会让您对这些概念的工作原理有一个很好的基本理解。

#4


2  

Here's the another good explanation from: http://www.onlineexpert.com/elearning/user/pdf/APPLICATIONDEVELOPMENT/SQL2KOLAP/Ch08.pdf.

以下是另一个很好的解释:http://www.onlineexpert.com/elearning/user/pdf/APPLICATIONDEVELOPMENT/SQL2KOLAP/Ch08.pdf。

It's similar to Preet Sangha's answer.

它类似于Preet Sangha的回答。

#1


12  

A tuple is a single hierarchy member taken from all the dimensions. Suppose Time.[2nd half] is a tuple of time dimension. At the same way we can have multiple tuples and we represent them in '(',')' brackets. Eg:

元组是从所有维度中获取的单个层次结构成员。假设时间。[下半部分]是时间维度的元组。同样,我们可以有多个元组,我们用'(',')'括号表示它们。例如:

(Time.[2nd half], Color.Dark.Red).

This is nothing but the mathematical intersection of nodes. we can represent the nodes in maths as (2,1) in the same way above expression will work.

这只不过是节点的数学交集。我们可以将数学中的节点表示为(2,1),就像上面的表达式一样。

Now coming to sets it is nothing but the composition of tuples. set contains one or more tuples it may zero also. we represent them in { , } braces. Eg:

现在开始设置它只不过是元组的组成。 set包含一个或多个元组,它也可能为零。我们用{,}括号代表它们。例如:

{ (Time.[1st half], Color.Dark.Red), (Time.[2nd half], Color.Dark.Blue) }

#2


13  

Having come to MDX from a more maths perspective this is my take on the question:

从更多的数学角度来看MDX,这是我对这个问题的看法:

Imagine you have 3d Cube with dimensions X, Y and Z. The number of cells in the cube is number of members in X multiplied by the number of members of Y multiplied by the number of members of Z.

想象一下你有三维立方体,尺寸为X,Y和Z.立方体中的单元格数是X中的成员数乘以Y的成员数乘以Z的成员数。

Each cell with have a coordinate in the cube based on a value from X, Y and Z. That coordinate is a Tuple.

每个单元格在立方体中具有基于X,Y和Z的值的坐标。该坐标是元组。

So lets say :

所以我们说:

  • X is Measures,
  • X是措施,
  • Y is Years,
  • Y是年,
  • Z is Products,
  • Z是产品,

Then a single cell could be the laptop sales for 1999. The cell coordinate will be: logically (X, Y, Z) and physically this is a tuple such as

然后单个单元格可能是1999年的笔记本电脑销售。单元格坐标将是:逻辑上(X,Y,Z)并且物理上这是一个元组,如

(Measures.Sales, Years.[1999], Products.[Laptop])  

Now lets say we want multiple cells, then we need multiple tuples, right? Yes, a Set is basically multiple tuples. Actually by multiple I include 0 and 1. So extending our example, we could have laptops from 1999 and desktops from 2001:

现在假设我们想要多个单元格,那么我们需要多个元组,对吗?是的,一个Set基本上是多个元组。实际上,通过多个我包括0和1.因此扩展我们的例子,我们可以拥有1999年的笔记本电脑和2001年的台式机:

{ 
    (Measures.Sales, Years.[1999], Products.[Laptop]) ,
    (Measures.Sales, Years.[2001], Products.[Desktop]) 
}

So you can see that you end up with multiple items with a set, and a single item with a tuple......

所以你可以看到你最终得到了一个带有一个集合的多个项目,以及一个带有元组的单个项目......

#3


5  

This article describes the terms Member, Tuple and Set in details.

本文详细介绍了Member,Tuple和Set这两个术语。

I'll try to explain it in an easy way.

我会尝试以简单的方式解释它。

Simply put, a tuple is an atomic slice of data in a dimension and a set is a collection of tuples. For example, you can have a Books dimension with tuples Sherlock Holmes, Tom Sawyer, CLR via C#, Code Complete and Quantum Physics for Dummies.
After that, you can organize these tuples into named sets, like Programming, Fiction and Natural Sciences.

简单地说,元组是维度中的原子数据片段,集合是元组的集合。例如,您可以使用元组Sherlock Holmes,Tom Sawyer,CLR通过C#,Code Complete和Quantum Physics for Dummies创建书籍维度。之后,您可以将这些元组组织成命名集,如编程,小说和自然科学。

[Books].&[Sherlock Holmes]                          -- Tuple
[Books].&[CLR via C#]                               -- Tuple
{ [Books].&[CLR via C#], [Books].&[Code Complete] } -- Set

There are certain functions in MDX that return sets or tuples, and it's often helpful to know how to convert a tuple to a set and vice versa. For example, the Item(...) function takes a specific tuple from a set. Enclosing multiple tuples in { , , } will create a set with these tuples.

MDX中有某些函数返回集合或元组,知道如何将元组转换为集合通常很有用,反之亦然。例如,Item(...)函数从集合中获取特定元组。在{,,}中包含多个元组将创建一个包含这些元组的集合。

The example I described is pretty partial and doesn't cover the whole theory, but it might give you a good basic understanding of how these concepts work.

我描述的例子非常局部,并不涵盖整个理论,但它可能会让您对这些概念的工作原理有一个很好的基本理解。

#4


2  

Here's the another good explanation from: http://www.onlineexpert.com/elearning/user/pdf/APPLICATIONDEVELOPMENT/SQL2KOLAP/Ch08.pdf.

以下是另一个很好的解释:http://www.onlineexpert.com/elearning/user/pdf/APPLICATIONDEVELOPMENT/SQL2KOLAP/Ch08.pdf。

It's similar to Preet Sangha's answer.

它类似于Preet Sangha的回答。