如何获得唯一ID列表的呼叫的唯一值?

时间:2019-01-13 13:16:50

标签: qlikview qliksense

我遇到以下问题:假设我在QlikView中加载了以下表格:

Table in Qlikview

现在,如果“通话时间超过60秒”为0,我想计算不同的ID数,“通话时间超过60秒”和“通话次数超过60秒”。

使用For count(distinct(if([calls over 60 sec]>0, ID)))我得到= 2,这是正确的。

现在for count(distinct(if([calls over 60 sec]=0 and [calls from other over 60 sec]>0, ID)))我得到3。

但是我要寻找的答案是1。因为整个月其他人只调用了1个id。

还是我需要Set表达式?基本上,我要为所选月份计算不同的ID数量以及上述条件。

我很感谢每个答案。

1 个答案:

答案 0 :(得分:0)

尝试

COUNT ( DISTINCT { < [calls over 60 sec]={"0"} , [calls from other over 60 sec] = { ">0" }  > }  ID)

还有aggr:

// SUM ( // sometimes

Aggr (
COUNT ( DISTINCT { < [calls over 60 sec]={"0"} , [calls from other over 60 sec] = { ">0" }  > }  ID)
, year, month
)

// )

而且,请不要在公式中使用“ IF”