MDX中使用成員屬性-資料庫專欄,SQL Server
在許多情況下,一些文字性的內容並非成員的資料,但為了顯示其內容,我們一般定義為成員的屬性,為了在
查詢中使用!比如[customers]維,其性別、住址、電話可能就是成員的屬性,在mdx查詢中,我們既想查詢數
據量,如銷售數量、銷售金額,也想查詢客戶的資訊,如性別、住址、電話等。mdx提供了幾種方法來獲取成員
的屬性。
1)dimension properties
select
{[measures].members} on columns,
{[customers].[all customers].[usa].[ca].[altadena].children}
dimension properties [customers].[name].gender,[customers].[name].address
on rows
from sales
可以查詢客戶的性別和地址屬性。
備註:在mdx例子應用中查詢語法正確,資料無法顯示,是否要通過adomd等才能正確獲取??
2)properties 函式
with
member [measures].[gender] as
[customers].currentmember.properties("gender")
member [measures].[address] as
[customers].currentmember.properties("address")
select
{ [measures].[gender], [measures].[address],[measures].members} on columns,
{[customers].[all customers].[usa].[ca].[altadena].children} on rows
from sales
在mdx顯示客戶性別、地址以及銷售金額等資訊。
備註:在mdx例子應用中資料正常顯示。
查詢中使用!比如[customers]維,其性別、住址、電話可能就是成員的屬性,在mdx查詢中,我們既想查詢數
據量,如銷售數量、銷售金額,也想查詢客戶的資訊,如性別、住址、電話等。mdx提供了幾種方法來獲取成員
的屬性。
1)dimension properties
select
{[measures].members} on columns,
{[customers].[all customers].[usa].[ca].[altadena].children}
dimension properties [customers].[name].gender,[customers].[name].address
on rows
from sales
可以查詢客戶的性別和地址屬性。
備註:在mdx例子應用中查詢語法正確,資料無法顯示,是否要通過adomd等才能正確獲取??
2)properties 函式
with
member [measures].[gender] as
[customers].currentmember.properties("gender")
member [measures].[address] as
[customers].currentmember.properties("address")
select
{ [measures].[gender], [measures].[address],[measures].members} on columns,
{[customers].[all customers].[usa].[ca].[altadena].children} on rows
from sales
在mdx顯示客戶性別、地址以及銷售金額等資訊。
備註:在mdx例子應用中資料正常顯示。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12921506/viewspace-201761/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SQL Server MDX中軸的使用SQLServer
- 初探SQL Server MDXSQLServer
- 使用屬性而不是可訪問的資料成員
- SQL Server 中的 ACID 屬性SQLServer
- 資料庫表欄位/JSP頁面Input域name屬性/專案entity類成員變數名稱一致資料庫JS變數
- Blazor使用sql server 資料庫BlazorSQLServer資料庫
- 【Case】SQL SERVER 屬性OWNER不可用於資料庫xxx。SQLServer資料庫
- Sql Server系列:資料庫組成及系統資料庫SQLServer資料庫
- SQL SERVER收集資料庫使用增量資料SQLServer資料庫
- sql server 大資料量表修屬性SQLServer大資料
- 在SQL Server資料庫中匯入MySQL資料庫Server資料庫MySql
- SQL Server中獲取資料庫名、表名、欄位名和欄位註釋的SQL語句SQLServer資料庫
- SQL Server資料庫管理員必備的DBCC命令SQLServer資料庫
- Sql server資料庫人員:常見錯誤(轉)SQLServer資料庫
- PG 資料庫查詢欄位屬性的指令碼資料庫指令碼
- python獲取、修改mysql資料庫欄位屬性PythonMySql資料庫
- Sql Server資料庫資料匯入到SQLite資料庫中Server資料庫SQLite
- SQL SERVER資料庫口令的脆弱性(轉)SQLServer資料庫
- SQL SERVER 資料庫查詢表和欄位資訊語句SQLServer資料庫
- 獲取sql server資料庫中所有庫、表、欄位名的方法SQLServer資料庫
- SQL Server資料庫安全SQLServer資料庫
- SQL Server 資料庫映象SQLServer資料庫
- SQL Server 資料庫索引SQLServer資料庫索引
- 在SQL Server資料庫中匯入匯出資料SQLServer資料庫
- Microsoft SQL Server 2005中的MDX指令碼功能介紹ROSSQLServer指令碼
- hibernate怎樣處理資料庫表中的有'default'屬性的欄位.資料庫
- Tomcat中訪問資料庫使用屬性檔案問題Tomcat資料庫
- sql server 資料庫中null 轉換為 0SQLServer資料庫Null
- 資料庫架構和物件、定義資料完整性-SQL Server資料庫架構物件SQLServer
- SQL SERVER備份資料庫檔案(使用SSMS)SQLServer資料庫SSM
- 在SQL Server下資料庫連結的使用SQLServer資料庫
- SQL Server 生成C#公共實體屬性和私有屬性SQLServerC#
- SQL Server收縮資料庫SQLServer資料庫
- 管理SQL Server資料庫安全SQLServer資料庫
- SQL Server資料庫遷移SQLServer資料庫
- 還原SQL Server資料庫SQLServer資料庫
- sql server跟蹤資料庫SQLServer資料庫
- SQL Server資料庫監控SQLServer資料庫