如何添加以下MDX,过滤器只能获得 [Percent_Of_Clicks]> = 0.01 的结果?
with
SET [Selected Measures] AS {[Measures].[CPC], [Measures].[CTR], [Measures].[Cost], [Measures].[Clicks]}
member [Sum_Of_Clicks] as sum({[KW Dim].[KWs].[KW] * [Ads Dim].[Ads].[Title] * [Country Dim].[Countrs].[Country]},[Measures].[Clicks])
member [Percent_Of_Clicks] as (iif(isempty([Measures].[Clicks]) or [Measures].[Clicks] = 0,0,([Measures].[Clicks]/[Sum_Of_Clicks]))),FORMAT_STRING = "0.00"
SELECT ORDER(NONEMPTY({[KW Dim].[KWs].[KW].ALLMEMBERS * [Ads Dim].[Ads].[Title].ALLMEMBERS * [Country Dim].[Countrs].[Country].ALLMEMBERS}),ASC) ON ROWS,
{[Selected Measures], [Percent_Of_Clicks],[Sum_Of_Clicks]} ON COLUMNS
FROM [CubeName]
WHERE {[Time].[Day ID].&[20140901]:[Time].[Day ID].&[20140914]} * {[Country Dim].[Countrs].[Country].[UK]}
答案 0 :(得分:0)
我不确定你想要过滤的是什么(所有轴?具体尺寸?) 但您是否尝试使用FILTER功能简单地包裹轴:
设置[选择的测量] AS {[测量]。[CPC],[测量]。[CTR],[测量]。[成本],[测量] [点击]}
成员[Sum_Of_Clicks]为总和({[KW Dim]。[KWs]。[KW] * [Ads Dim]。[Ads]。[Title] * [Country Dim]。[Countrs]。[Country]} ,[措施]。[点击次数])
成员[Percent_Of_Clicks]为(iif(isempty([Measures]。[Clicks])或[Measures]。[Clicks] = 0,0,([Measures]。[Clicks] / [Sum_Of_Clicks]))), FORMAT_STRING =“0.00”
SELECT ORDER( 过滤器(强> NONEMPTY({[KW Dim]。[KWs]。[KW] .ALLMEMBERS * [Ads Dim]。[Ads]。[Title] .ALLMEMBERS * [Country Dim]。[Countrs]。[Country] .ALLMEMBERS}) 下,[Percent_Of_Clicks] GT; = 0)强> ,ASC
)ON ROWS, {[Selected Measures],[Percent_Of_Clicks],[Sum_Of_Clicks]} ON COLUMNS
FROM [CubeName]
WHERE {[Time]。[Day ID]。& [20140901]:[Time]。[Day ID]。& [20140914]} * {[Country Dim]。[Countrs]。[Country]。 [英国]}