Difference between tuple and set in mdx

前端 未结 4 2060
半阙折子戏
半阙折子戏 2021-02-07 14:45

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

4条回答
  •  深忆病人
    2021-02-07 15:02

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

    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.

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

    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.

提交回复
热议问题