Databases Reference
In-Depth Information
on top of the result of an SQL query, in much the same way that views in a relational
database are defined.
A named calculation enables you to define a column in a DSV table that is the result of a
calculation or expression based on other columns in the same table. Named calculations
and named queries give you greater flexibility and help to solve the problems involved in
mapping relational tables to multidimensional objects.
Listing 18.2 shows a portion of a DSV containing a named calculation that sets Count to 1
for every row in the table. The named calculation is added to the DSV fragment contain-
ing the dbo_currency table shown in Listing 18.1.
LISTING 18.2
A Named Calculation in a DSV
<xs:schema id=”Foodmart2008 ....
<xs:element name=”Foodmart2008
<xs:complexType>
<xs:choice minOccurs=”0” maxOccurs=”unbounded”>
<xs:element name=”dbo_currency”
<xs:complexType>
<xs:sequence>
<xs:element name=”currency_id” msprop:FriendlyName=
”currency_id” msprop:DbColumnName=”currency_id” msprop:design-time-name=”a6b6df3d-
0cd1-443e-942c-13c765410175” type=”xs:int” minOccurs=”0” />
<xs:element name=”date” msprop:FriendlyName=”date”
msprop:DbColumnName=”date” msprop:design-time-name=”2b44ca8c-b80e-480f-a173-
5a0490542908” type=”xs:dateTime” minOccurs=”0” />
<xs:element name=”currency” msprop:FriendlyName=”currency”
msprop:DbColumnName=”currency” msprop:design-time-name=”e48ef4a5-7feb-4fbc-9023-
5b0da75ab054” minOccurs=”0”>
<xs:simpleType>
<xs:restriction base=”xs:string”>
<xs:maxLength value=”15” />
</xs:restriction>
</xs:simpleType>
<xs:element name=”Count” msdata:ReadOnly=”true” msprop:design-
time-name=”444d9cec-9df3-4186-9c6a-01697e361075” msprop:DbColumnName=”Count”
msprop:ComputedColumnExpression=”1” msprop:Description=”” msprop:IsLogical=”True”
type=”xs:int” />
. . .
 
Search WWH ::




Custom Search