如何在MicroStrategy中进行条件计数?

时间:2016-12-20 15:12:07

标签: business-intelligence microstrategy

尝试在MicroStrategy中执行以下语句无济于事。

Count(Distinct case when Insight <> 'Missing' then call_discuss_sk else null end)

Count(Distinct case when Quarters_to_this_quarter between 1 and 5 then call_discuss_sk else null end)

当前的MSTR代码如下所示,可以确认这不起作用......

Count<Distinct=True, UseLookupForAttributes=False>(ApplySimple("case when #0='Missing' then NULL else #1 END",Insight,[Call Discuss Sk])){~}

表I&#39; m查询如下所示

enter image description here

1 个答案:

答案 0 :(得分:0)

所以这是怎么做的,注意#0和#1引用“”语句之后的字段,所以在这种情况下#0 = Insight和#1 = [Call Discuss Sk]

ApplyAgg("Count(Case when #0='Missing' then null else #1 end)", Insight, [Call Discuss Sk]){~+}