Username: Password:

空单元格的使用-数据库专栏,SQL Server
来源:作者: 发布时间:2007-12-25 13:52:18


使用mdx数值函数如avg、count等的时候,通常会忽略空单元格!唯一的例外是count函数。他提供了includeempty
参数,指明是否包括空单元格。
1:non empty关键字
一般使用在轴级别。
select
    {[measures].[store sales]} on columns,
    non empty {[time2].[任何 time2].[1997].[q4].[10].children} on rows
from sales
显示1997年10月每日非空的销售。
无non empty关键字则显示任何销售。
2:count
10月销售日计数(无论有无销售)
with member [time2].[销售日] as count([time2].[任何 time2].[1997].[q4].[10].children)
select
   {[measures].[store sales]} on columns,
    {[time2].[销售日]} on rows
from sales

10月销售日计数(仅包括有销售日期)
with member [time2].[销售日] as count([time2].[任何 time2].[1997].[q4].[10].children,
excludeempty)
3:sum和avg等函数
这些函数对于空单元,则忽略!(不转换为0)

 

 

喜欢本文,那就收藏到:

    Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网
相关评论  我也要评论
还没有关于此文章的相关评论!
  • 昵称: (为空则显示guest)
  • 评论分数: ★ ★ ★★★ ★★★★ ★★★★★
  • 评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
  • 导航
    赞助商
    文章类别
    订阅