我是 MDX 查询的新手。我有以下查询,并希望将结果限制为仅显示 Margin Pct > 0 的记录。任何帮助将不胜感激。
和 MEMBER [Measures].[Margin Pct] as ([Measures].[Mgmt Margin Excluding Markup]/[Measures].[Net Sales])*100,format_string="0.0" MEMBER [Measures].[Mgmt Margin] as [Measures].[Mgmt Margin Excluding Markup],format_string="0.0" MEMBER [Measures].[Mgmt Cost Unit] as [Measures].[Mgmt Cost Unit Excluding Markup],format_string="0.00" 成员 [Measures].[FOBPrce] as [Measures].[FOB 价格],format_string="0.00" 成员 [Measures].[CommUnt] as [Measures].[Comm/Unit],format_string="0.000" 成员 [Measures].[RebUnt] as [Measures].[Reb/Unit],format_string="0.00" 成员 [Measures].[FrtUnt] as [Measures].[Frt/Unit],format_string="0.00" 成员 [Measures].[PriceUnt] as [Measures].[Price/Unit],format_string="0.00" 选择非空{ [措施].[Rpt Inv Shp Date], [措施]。[运送磅数], [措施].[净销售额], [措施]。[FOBPrce], [措施].[CommUnt], [措施]。[RebUnt], [措施].[FrtUnt], [措施].[PriceUnt], [措施].[管理成本单位], [措施].[管理保证金], [措施].[保证金百分比] } 在列上,非空 { ( [项目].[分组排序].[分组排序], [项目].[表单排序].[表单排序], [项目].[物种分类].[物种分类], {[Item].[Group thru Item ID].[Group].ALLMEMBERS}, [虾群].[虾群].[虾群名称].ALLMEMBERS , {[项目].[表格].[表格].ALLMEMBERS}, [项目].[肉 - 带壳].[肉或带壳].ALLMEMBERS , [项目].[超级物种].[超级物种].ALLMEMBERS , {[项目].[物种].[物种].ALLMEMBERS}, {[项目].[项目 ID].[项目 ID].ALLMEMBERS}, [项目].[Desc-ItemID].[项目 ID 说明].ALLMEMBERS , [项目].[包装类型].[包装].ALLMEMBERS , {[品牌].[品牌].[品牌名称].ALLMEMBERS}, {[仓库].[仓库].[仓库代码].ALLMEMBERS}, [Order Invoice Lot].[Order-Invoice-Lot].[Lot].ALLMEMBERS , {[客户账号].[客户账号].Levels(1)}, {[运送给客户].[客户名称].Levels(1)}, {[销售人员].[Person].Levels(1)}, [订单发票批次].[销售订单].[销售订单].ALLMEMBERS , [订单发票批次].[发票].[发票].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT StrToSet( '{[Breaded Group].[Breaded Group].[All]}' ,CONSTRAINED ) ON COLUMNS FROM ( SELECT StrToSet( '{[Inventory Category].[Inventory Category].[All]}' ,CONSTRAINED ) 来自 ( SELECT StrToSet( '{[Sold To Customer].[Customer Buying Group].[All]}' ,CONSTRAINED ) ON COLUMNS FROM ( SELECT StrToSet('{[Ship To Customer Sales Group].[Ship To Customer Sales Group].[All]}' ,CONSTRAINED ) ON COLUMNS FROM ( SELECT StrToSet( '{[Sold To Customer].[Customer Legal Group].[All]}' ,CONSTRAINED ) ON COLUMNS FROM ( SELECT StrToSet('{[Country Of Origin].[Long Name].[All]}' ,CONSTRAINED ) ON COLUMNS FROM ( SELECT StrToSet( '{[Is Sample].[Sample].[Description].[Regular]}' ,CONSTRAINED ) ON COLUMNS FROM ( SELECT StrToSet('{[Invoicing Status].[Invoicing Status-Detail].[Detail].[Sale Only],[Invoicing Status].[Invoicing Status-Detail].[Detail].[Credit Only]}' ,CONSTRAINED ) 从 ( SELECT StrToSet('{[Invoice Date].[Fiscal Year-Quarter-Month].[Fiscal Month].[Jul-FY13]}' ,CONSTRAINED ) 从 ( SELECT StrToSet( '{[Sold To Customer].[Name].[All]}' ,CONSTRAINED ) ON COLUMNS FROM ( SELECT StrToSet('{[Is NRV].[NRV].[All]}' ,CONSTRAINED ) 来自 [FishTrackerReporting] 的列 ) ) ) ) ) ) ) ) ) )
我尝试对 [Measures].[Margin Pct] 使用 where 子句,但出现此错误:
WHERE 子句函数需要参数的元组集表达式。使用了字符串或数字表达式。
我还尝试在查询的 on columns 部分之后使用过滤器,但出现内存不足的问题,所以我认为我遗漏了一些东西。