MDX向客户展示';我这个月下订单,但去年这个月没有

MDX向客户展示';我这个月下订单,但去年这个月没有,mdx,olap,Mdx,Olap,我很难想象mdx会返回本月已下订单但未下上一年当月订单(销售额为0美元)的所有客户 我将订单金额作为度量,CustomerId作为维度,日期作为维度。您需要添加一些您已经尝试过的代码 在mdx伪代码中,它是这样的: Except( NonEmpty( {all members} //<<try a function that returns a set such as `.MEMBERS` ,(th

我很难想象mdx会返回本月已下订单但未下上一年当月订单(销售额为0美元)的所有客户


我将订单金额作为度量,CustomerId作为维度,日期作为维度。

您需要添加一些您已经尝试过的代码

mdx
伪代码中,它是这样的:

  Except(  
    NonEmpty(
       {all members}                      //<<try a function that returns a set such as `.MEMBERS`
       ,(thisMonth, OrderAmountMeasure)   //<<the braces mean this is a tuple made up of two members
    )
   ,NonEmpty(
       {all members}                
       ,(equivMonthLastYear, OrderAmountMeasure)   //<<you could try the .LAG function to go back 12 months
    )
   )
除(
非空(

{all members}//除了在多维数据集中没有EquivalMonthLastYear的值时,您的伪代码可以工作。在这种情况下,我不想返回currentMonthThisYear。@user5982263您可以通过
IIF
函数添加一些额外的逻辑:
  iif(
     equivMonthLastYear = 0,
     null,
  Except(  
    NonEmpty(
       {all members}                      //<<try a function that returns a set such as `.MEMBERS`
       ,(thisMonth, OrderAmountMeasure)   //<<the braces mean this is a tuple made up of two members
    )
   ,NonEmpty(
       {all members}                
       ,(equivMonthLastYear, OrderAmountMeasure)   //<<you could try the .LAG function to go back 12 months
    )
   )
 )