0

如何从我的 MDX 查询结果中删除空行?

这是我目前正在使用的查询

    select
    non empty 
    {
[Measures].[Average Trips Per Day]
,[Measures].[Calories Burned]
,[Measures].[Carbon Offset]
,[Measures].[Median Distance]
,[Measures].[Median Duration]
,[Measures].[Rider Trips]
,[Measures].[Rides Per Bike Per Day]
,[Measures].[Total Distance]
,[Measures].[Total Riders]
,[Measures].[Total Trip Duration in Minutes]
,[Measures].[Total Members]
    } on columns
    ,
    non empty 
    {
    (
    [Promotion].[Promotion Code Name].children
)
    } on rows 
from [BCycle]
where ([Program].[Program Name].&[Madison B-cycle])

; 结果

4

1 回答 1

0

这不是空值,但它是 [Promotion].[Promotion Code Name].Children 的子项之一。

EXCEPT您可以使用MDx 关键字从子项中排除该特定值。

示例查询:

   //This query shows the number of orders for all products,  
   //with the exception of Components, which are not  
   //sold.  
SELECT   
   [Date].[Month of Year].Children  ON COLUMNS,  
   Except  
      ([Product].[Product Categories].[All].Children ,  
         {[Product].[Product Categories].[Components]}  
      ) ON ROWS  
FROM  
   [Adventure Works]  
WHERE  
   ([Measures].[Order Quantity])  

参考-> https://docs.microsoft.com/en-us/sql/mdx/except-mdx-function?view=sql-server-2017

于 2018-11-28T09:44:33.930 回答