datazen&MDX学习笔记

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了datazen&MDX学习笔记相关的知识,希望对你有一定的参考价值。

1. 得到当前时间例子

with member thismonth as format(dateadd(‘d‘,-1,now()),‘yyyyMM‘)
select 
{
[Measures].[销售成本],
[Measures].[销售金额],
[Measures].[销售利润]
}
on 0,
non empty{
[Dim Product].[SEASON KEY].children*
[Dim Product].[PRICETIER KEY].children*
[Dim Shop].[AREA].children*
[Dim Shop].[SHOP].children
} on 1
from [HxDataWarehouse]
where strtoset(‘([Dim Date].[Calendar].[MONTH KEY].&[‘+thismonth+‘])‘)

2. DATAZEN时间参数传递。这里datazen时间的处理还是有问题,应该会有更好的方式,暂时没时间研究。

with member sstartdate as left(‘{{ @startdate }}‘,10)
member senddate as left(‘{{ @enddate }}‘,10)
member tstartdate as str(year(sstartdate))+right("0"+str(month(sstartdate)),2)+right("0"+str(day(sstartdate)),2)
member tenddate as str(year(senddate))+right("0"+str(month(senddate)),2)+right("0"+str(day(senddate)),2)
select 
{
[Measures].[销售成本],
[Measures].[销售金额],
[Measures].[销售利润]
}
on 0,
non empty{
[Dim Product].[商品属性].children*
[Dim Shop].[SHOP].children
} on 1
from [HxDataWarehouse]
where 
strtoset(‘([Dim Date].[DATE KEY].&[‘+tstartdate+‘]:[Dim Date].[DATE KEY].&[‘+tenddate+‘])‘)

3. 同时把keycolumn和namecolumn查出来。

 

select
    [Measures].[销售金额] on 0, 
non empty{[Dim Shop].[AREA].children } DIMENSION PROPERTIES MEMBER_KEY on 1
from 
[HxDataWarehouse]

 

WITH
MEMBER [Measures].[Parent Member Name] AS
[Product].[Product Categories].CurrentMember.Properties("LEVEL_NUMBER") 

SELECT
{([Measures].[Parent Member Name])} ON COLUMNS,
{[Product].[Product Categories].AllMembers} ON ROWS
FROM [Step-by-Step];

 

以上是关于datazen&MDX学习笔记的主要内容,如果未能解决你的问题,请参考以下文章

Datazen图表创建和公布

Datazen 自定义地图--中国地图

Datazen自己定义地图

[原创]java WEB学习笔记61:Struts2学习之路--通用标签 property,uri,param,set,push,if-else,itertor,sort,date,a标签等(代码片段

MDX 组维度 y 新维度

MDX 在层次结构之间导航