📄 createdatabase.xmla
字号:
<ColumnID>store_sales</ColumnID>
</Source>
</Source>
<FormatString>Currency</FormatString>
</Measure>
<Measure>
<ID>Store Cost</ID>
<Name>Store Cost</Name>
<Source>
<DataType>Currency</DataType>
<Source xsi:type="ColumnBinding">
<TableID>sales_fact_1997</TableID>
<ColumnID>store_cost</ColumnID>
</Source>
</Source>
<FormatString>Currency</FormatString>
</Measure>
<Measure>
<ID>Min Unit Sales</ID>
<Name>Min Unit Sales</Name>
<AggregateFunction>Min</AggregateFunction>
<Source>
<DataType>Double</DataType>
<Source xsi:type="ColumnBinding">
<TableID>sales_fact_1997</TableID>
<ColumnID>unit_sales</ColumnID>
</Source>
</Source>
<FormatString>#</FormatString>
</Measure>
<Measure>
<ID>Max Unit Sales</ID>
<Name>Max Unit Sales</Name>
<AggregateFunction>Max</AggregateFunction>
<Source>
<DataType>Double</DataType>
<Source xsi:type="ColumnBinding">
<TableID>sales_fact_1997</TableID>
<ColumnID>unit_sales</ColumnID>
</Source>
</Source>
<FormatString>Standard</FormatString>
</Measure>
<Measure>
<ID>Distinct Customers</ID>
<Name>Distinct Customers</Name>
<AggregateFunction>DistinctCount</AggregateFunction>
<Source>
<DataType>Integer</DataType>
<Source xsi:type="ColumnBinding">
<TableID>sales_fact_1997</TableID>
<ColumnID>customer_id</ColumnID>
</Source>
</Source>
<FormatString>#,#</FormatString>
</Measure>
</Measures>
<StorageMode>Molap</StorageMode>
<ProcessingMode>Regular</ProcessingMode>
<Dimensions>
<Dimension xsi:type="RegularMeasureGroupDimension">
<CubeDimensionID>Store</CubeDimensionID>
<Attributes>
<Attribute>
<AttributeID>Store Name</AttributeID>
<Type>Granularity</Type>
</Attribute>
</Attributes>
</Dimension>
<Dimension xsi:type="RegularMeasureGroupDimension">
<CubeDimensionID>Promotion</CubeDimensionID>
<Attributes>
<Attribute>
<AttributeID>promotion_id</AttributeID>
<Type>Granularity</Type>
</Attribute>
</Attributes>
</Dimension>
<Dimension xsi:type="RegularMeasureGroupDimension">
<CubeDimensionID>Product</CubeDimensionID>
<Attributes>
<Attribute>
<AttributeID>Product Name</AttributeID>
<Type>Granularity</Type>
</Attribute>
</Attributes>
</Dimension>
<Dimension xsi:type="RegularMeasureGroupDimension">
<CubeDimensionID>Customer</CubeDimensionID>
<Attributes>
<Attribute>
<AttributeID>Customer Name</AttributeID>
<Type>Granularity</Type>
</Attribute>
</Attributes>
</Dimension>
</Dimensions>
<Partitions>
<Partition>
<ID>Sales Fact 1997</ID>
<Name>Sales Fact 1997</Name>
<Source xsi:type="TableBinding">
<DataSourceID>Food Mart 2000</DataSourceID>
<DbTableName>sales_fact_1997</DbTableName>
</Source>
<StorageMode>Molap</StorageMode>
<ProcessingMode>Regular</ProcessingMode>
</Partition>
<Partition>
<ID>Sales Fact 1998</ID>
<Name>Sales Fact 1998</Name>
<Source xsi:type="TableBinding">
<DataSourceID>Food Mart 2000</DataSourceID>
<DbTableName>sales_fact_1998</DbTableName>
</Source>
<StorageMode>Molap</StorageMode>
<ProcessingMode>Regular</ProcessingMode>
</Partition>
<Partition>
<ID>Sales Fact Dec 1998</ID>
<Name>Sales Fact Dec 1998</Name>
<Source xsi:type="TableBinding">
<DataSourceID>Food Mart 2000</DataSourceID>
<DbTableName>sales_fact_dec_1998</DbTableName>
</Source>
<StorageMode>Molap</StorageMode>
<ProcessingMode>Regular</ProcessingMode>
</Partition>
</Partitions>
</MeasureGroup>
</MeasureGroups>
<Source>
<DataSourceViewID>Food Mart 2000</DataSourceViewID>
</Source>
<MdxScripts>
<MdxScript>
<ID>item</ID>
<Name>name</Name>
<Commands>
<Command>
<Text>CALCULATE</Text>
</Command>
<Command>
<Text>
CREATE MEMBER CURRENTCUBE.[MEASURES].[Units Average Per Order]
AS '[Measures].[Units Ordered]/[Measures].[Order Count]',
VISIBLE = 1,
FORMAT_STRING = "#,#.00"
</Text>
</Command>
<Command>
<Text>
CREATE MEMBER CURRENTCUBE.[MEASURES].[Profit]
AS '[Measures].[Store Sales]-[Measures].[Store Cost]',
VISIBLE = 1,
FORMAT_STRING = "Currency"
</Text>
</Command>
<Command>
<Text>
CREATE MEMBER CURRENTCUBE.[MEASURES].[Store Cost Percentage]
AS '[Measures].[Store Cost]/[Measures].[Store Sales]',
VISIBLE = 1,
FORMAT_STRING = "Percent"
</Text>
</Command>
</Commands>
</MdxScript>
</MdxScripts>
</Cube>
</Cubes>
<DataSources>
<DataSource xsi:type="RelationalDataSource">
<ID>Food Mart 2000</ID>
<Name>Food Mart 2000</Name>
<ConnectionString>Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\ProgrammingSQL2005\Chapter19\ssms\XMLA Demos\foodmart 2000.mdb;</ConnectionString>
<ImpersonationInfo>
<ImpersonationMode>ImpersonateServiceAccount</ImpersonationMode>
</ImpersonationInfo>
</DataSource>
</DataSources>
<DataSourceViews>
<DataSourceView>
<ID>Food Mart 2000</ID>
<Name>Food Mart 2000</Name>
<DataSourceID>Food Mart 2000</DataSourceID>
<Schema>
<xs:schema id="Food_x0020_Mart_x0020_2000" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop">
<xs:element name="Food_x0020_Mart_x0020_2000" msdata:IsDataSet="true" msprop:design-time-name="dataSet1">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Customer" msprop:TableType="Table" msprop:design-time-name="dataTable1"
msprop:DbTableName="Customer" msprop:FriendlyName="Customer">
<xs:complexType>
<xs:sequence>
<xs:element name="customer_id" msprop:DataSize="-1" msprop:DbColumnName="customer_id" msprop:design-time-name="dataColumn1"
msprop:FriendlyName="customer_id" type="xs:int" />
<xs:element name="account_num" msprop:DataSize="-1" msprop:DbColumnName="account_num" msprop:design-time-name="dataColumn2"
msprop:FriendlyName="account_num" type="xs:double" minOccurs="0" />
<xs:element name="lname" msprop:DataSize="100" msprop:DbColumnName="lname" msprop:design-time-name="dataColumn3"
msprop:FriendlyName="lname" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="fname" msprop:DataSize="50" msprop:DbColumnName="fname" msprop:design-time-name="dataColumn4"
msprop:FriendlyName="fname" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="mi" msprop:DataSize="20" msprop:DbColumnName="mi" msprop:design-time-name="dataColumn5"
msprop:FriendlyName="mi" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="20" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="address1" msprop:DataSize="100" msprop:DbColumnName="address1" msprop:design-time-name="dataColumn6"
msprop:FriendlyName="address1" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="address2" msprop:DataSize="100" msprop:DbColumnName="address2" msprop:design-time-name="dataColumn7"
msprop:FriendlyName="address2" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="address3" msprop:DataSize="100" msprop:DbColumnName="address3" msprop:design-time-name="dataColumn8"
msprop:FriendlyName="address3" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="address4" msprop:DataSize="100" msprop:DbColumnName="address4" msprop:design-time-name="dataColumn9"
msprop:FriendlyName="address4" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="city" msprop:DataSize="50" msprop:DbColumnName="city" msprop:design-time-name="dataColumn10"
msprop:FriendlyName="city" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="state_province" msprop:DataSize="50" msprop:DbColumnName="state_province"
msprop:design-time-name="dataColumn11" msprop:FriendlyName="state_province" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="postal_code" msprop:DataSize="50" msprop:DbColumnName="postal_code" msprop:design-time-name="dataColumn12"
msprop:FriendlyName="postal_code" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="country" msprop:DataSize="50" msprop:DbColumnName="country" msprop:design-time-name="dataColumn13"
msprop:FriendlyName="co
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -