官术网_书友最值得收藏!

Other attribute forms

Attributes may have more forms than just an ID or a name. More often than not you'll find long descriptions, SKUs, Social Security Numbers, previous companies' codes still in use, and so on. Or, in the case of a customer, you may have an e-mail address that sometimes you want to use in a report. Those descriptive fields that uniquely refer to an element of an attribute can be used as alternate forms. When creating an alternate form, it is always useful to ask the question: is this a form or a totally different attribute? The customer's birthday, for example, would be a different attribute, since we may later filter or GROUP BY this column; and surely does not uniquely identify a single customer.

Getting ready

You need to have completed the previous recipes to do this one. We are now adding the long description to the Product attribute.

How to do it...

We are modifying the Product attribute:

  1. Go to the Schema Objects | Attribute folder. Double-click on the yellow Product icon.
  2. If you see a message like the one in the following screen capture, it is very important that you click on the second option Edit: This will lock all schema objects in this project from other users. Otherwise, you won't be allowed to modify the attribute:
  3. When the Attribute Editor opens, click on New.
  4. In Create New Form Expression drag the column EnglishDescription to the Form Expression text area. Mapping method should be Manual. Click on OK.
  5. Check the DimProduct table, and now look at the Form general information area down to the left.
  6. In the textbox called Name, type LDESC and close this dialog clicking on the OK button. See that in the Attribute Editor now we have three forms.
  7. Click on Save and Close, update the schema.

How it works...

We can have as many forms as we want in an attribute, as long as they come from the same lookup table. Forms can be text, numbers, dates, or other datatypes. When it comes to displaying forms on a report, DESC will be always displayed by default (if present), and you will have the option to select which other forms are shown by right-clicking on an attribute header.

There's more...

If you selected Read Only in step 2 in this recipe, the project schema is now locked. You won't be able to make changes until you unlock it. This is useful in development environments where multiple persons are working on the same metadata and you want to freeze the project.

To unlock it, use the Schema | Read Only Mode… menu and uncheck the option.

Note

You can watch a screencast of this operation at:

Exercise 7

Create a new form for the Customer attribute. Use the EmailAddress field from the DimCustomer table. Give the name EMAIL and in the Form format field select the Type as Email.

主站蜘蛛池模板: 三明市| 满洲里市| 读书| 长海县| 黄浦区| 内丘县| 伊宁县| 盈江县| 樟树市| 牙克石市| 盐津县| 邻水| 肥东县| 陕西省| 黄梅县| 钦州市| 鸡东县| 申扎县| 滨州市| 若羌县| 无锡市| 监利县| 报价| 三门峡市| 西乡县| 英超| 山西省| 南乐县| 贡嘎县| 哈巴河县| 湘阴县| 益阳市| 宁化县| 新巴尔虎左旗| 固原市| 麻阳| 昔阳县| 若羌县| 图木舒克市| 景东| 彰化市|