6.2 define a nameset

Source: Internet
Author: User
Define the nameset:

A nameset is a multidimensional expression (MDX) that returns a group of dimension members ). You can define a nameset and save it as part of a multi-dimensional dataset definition. You can also apply it on the client.ProgramCreate a nameset. You can create a nameset by combining Multidimensional Dataset data, Arithmetic Operators, numbers, and functions. The name set can be used by the user in the MDX query of the client application, and can also be used to define the set in the subcube. A subcube is a set of cross-join sets. It limits the cube space to the sub-spaces defined by subsequent statements. Defining restricted multi-dimensional dataset space is a basic concept of MDX scripts. The next topic of this course will discuss the MDX script.

The nameset simplifies MDX queries and provides useful aliases for complex and common set expressions. For example, you can define a nameset named "large distributors" to include a set of Members from the "distributors" dimension with the maximum number of employees. Then, the end user can use the "Large distributor" nameset in the query. You can also use this nameset to define the set in the subcube. Nameset definitions are stored in multidimensional datasets, but their values only exist in memory. To create a nameset, use"Computing"Tab"Create a nameset"Command. For more information, see , .

In the task of this topic, two naming sets are defined: "core products" and "large distributors.

Define the "core product" name set
Define the "core product" name set
  1. Switch to"Computing"Tab, and then click"Form View".

  2. Click"Script organization program"In the pane"[Total sales ratio of all products]"And then"Computing"Click"Create a nameset".

    In"Computing"When defining new computations on the tab, remember that the calculation Parsing is based on"Script organization program"The order in the pane. When you create a new computing, the focus in this pane determines the execution sequence of the computing. The new computing is defined after the computing with focus.

  3. In"Name"Box, change the name of the new nameset[Core products].

    In"Script organization program"In the pane, note the unique icon used to distinguish the nameset from the script command or computing member.

  4. In"Computing tools"In the pane"Metadata"Tab, expand"Product","Category","Member"And"All products".

If you cannot"Computing tools"To view any metadata, click"Reconnect". If this operation fails, you may have to process the multi-dimensional dataset or start the Analysis Services instance.

 

 

    1. Set"Bicycle"Drag"Expression"Box.

      Now you have created a group of expressions that return the member set in the bicycle category in the Product Dimension.

      Displays"Computing expression"Pane.

Define a "large distributor" nameset
Define a "large distributor" nameset

  1. In"Script organization program"Right-click in the pane[Core products]And then click"Create a nameset".

  2. In"Name"Box, change the name of this nameset[Large distributors].

  3. In"Expression"EnterExists ().

    You will useExistsFunction to return a Member set from the Attribute Hierarchy of a "large distributor, the "distributor name" Attribute Hierarchy interacts with the member set in the "Number of employees" Attribute Hierarchy with the maximum number of employees.

  4. In"Computing tools"In the pane"Metadata"Tab, expand"Distributor"Dimension, and then expand"Distributor name"Attribute Hierarchy.

  5. drag the distributor name level to the brackets of the exists set expression.

    all members of the set are returned using the Members function. related topics:

  6. enter a full stop after some set expressions, and then add the Members function. The expression should be shown as follows:

    copy Code
     exists ([reseller]. [reseller name]. [reseller name]. Members) 

    since the first set is defined for the exists set expression, now you can add the second set, that is, the member set of the "distributor" dimension that contains the maximum number of employees.

  7. In"Computing tools"In the pane"Metadata"Tab to expand"Number of employees","Member"And"All distributors".

    Note: The members of this Attribute Hierarchy are not grouped.

  8. Open"Distributor"Dimension designer, and then"Attribute"In the pane, click"Number of employees".

  9. In the "properties" window, SetDiscretizationmethodProperty changed"Automatic", And thenDiscretizationbucketcountProperty changed5.Related Topics:

  10. In business intelligence development studio"Generate"Click"Deployment Analysis Services tutorial".

  11. After the deployment is completed, switch to the multidimensional cube designer of the Analysis Services tutorial cube, and then"Computing"Click"Reconnect".

  12. On the "metadata" tab in the computing tools pane, expand "Number of employees" , "members" , and In the "distributor" dimension. "All distributors" .

    Note: Members of this Attribute Hierarchy are now included in five groups numbered 0 to 4. To view the group ID, pause the pointer on the Group to view infotip. The reason for grouping members of this Attribute Hierarchy Is That The discretizationbucketcount attribute is set to 5 , the discretizationmethod attribute is set to "automatic" .

  13. In"Expression"InExistsIn the set expressionMembersAdd a comma before the function and the parentheses, and then83-100Slave"Metadata"Drag and Drop the pane to a comma.

    Now, when you place the "Large distributor" nameset on the axis, you are done and will return with two specified sets (all distributor sets and distributors with 83 to 100 employees) theExistsSet expression.

    Display[Large distributors]The"Computing expression"Pane.

  14. In"Computing"On the toolbar of the tab, click"Script View"And then check the two namesets added to the computing script.

  15. Add a new line before the first create set command in the computing script, and add the following text to the independent line in the script:

    copy Code
    /* named sets */

    now, you have defined two naming sets, they are displayed in the script organizer pane. Now, you can deploy these two naming sets and then browse these measurement values in the analysis services tutorial multidimensional data set.

Use the new nameset to browse Multi-Dimensional Datasets
Use the new nameset to browse Multi-Dimensional Datasets

  1. In bi development studio"Generate"Click"Deployment Analysis Services tutorial".

  2. After the deployment is completed, click"Browser"Tab, and then click"Reconnect".

  3. Slave"Data"Delete all hierarchies and measurement values in the pane.

  4. Set"Distributor sales-sales"Add the measurement value to the data area, and then"Product category"Add the User-Defined hierarchy to the row area.

    Note that only one member of the category attribute will appear. This is because this attribute has previously been used as a filter in this session. If you work in a new session, all members are displayed.

  5. Select"Line"Region"Category"Next to the drop-down key header, and then select"(All )"Check box next to level to select all members of this level (if not selected), and then click"OK".

  6. Expand"Bicycle"To view"Subcategory"See.

  7. In"Metadata"In the pane"Product"Dimension, right-click"Core products"And select"Add to subcube area".

    Note that only"Category"Attribute"Bicycle"Member and"Bicycle"The member of the subclass will stay in the multi-dimensional dataset. This is because"Core products"The nameset is used to define a subcube. The attributes of this subcube appear in"Data"The"Filter"Pane. This subcube causes"Product"Dimension"Category"Attribute members are limited"Core products"Shows the members of The nameset.

  8. In"Metadata"In the pane, expand"Distributor", Right-click"Large distributors"And then click"Add to subcube area".

    Note,"Data"The "distributor sales" Metric In the pane only displays the sales of large bicycle distributors. Also note that,"Filter"The pane displays the two namesets used to define the specific subcube, as shown in.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.