我正在努力解决mdx看起来想要退回本月订购但未在去年同一月下订单(0美元销售额)的客户。
我将Order Amount作为度量,CustomerId作为维度,Date作为维度。
答案 0 :(得分:1)
您需要添加一些您已经尝试过的代码。
在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
)
)
编辑:
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
)
)
)