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

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.

主站蜘蛛池模板: 额济纳旗| 温州市| 沈丘县| 白沙| 砚山县| 和林格尔县| 通州市| 秭归县| 无棣县| 九江县| 青浦区| 襄垣县| 镇宁| 宣化县| 柳河县| 祁门县| 徐州市| 内江市| 泽库县| 柳林县| 缙云县| 甘谷县| 灵璧县| 项城市| 米易县| 元朗区| 吉隆县| 新龙县| 益阳市| 南漳县| 博客| 伊宁县| 五大连池市| 辉县市| 莫力| 从江县| 保靖县| 东光县| 观塘区| 绥中县| 普陀区|