在spotfire中是否有办法根据不同的日期识别列中的重复值?
假设有列:Date
,Store number
,Result
我们看到商店号码27,35在不同的日期重复出现,它应该在结果栏中显示为Y.但是如果商店号码在同一天重复出现,则不应该考虑它。
+------------+----------+-----------------------------+
| Date | Store No | Result in Calculated Column |
+------------+----------+-----------------------------+
| 05/14/2015 | 23 | |
| 05/14/2015 | 27 | Y |
| 05/14/2015 | 23 | |
| 05/14/2015 | 35 | Y |
| 05/14/2015 | 2 | |
| 05/14/2015 | 27 | Y |
| 05/15/2015 | 31 | |
| 05/15/2015 | 101 | |
| 05/15/2015 | 88 | |
| 05/15/2015 | 31 | |
| 05/15/2015 | 27 | Y |
| 05/15/2015 | 35 | Y |
+------------+----------+-----------------------------+
答案 0 :(得分:1)
您需要将INTERSECT()
与OVER
子句一起使用。
If(Count([Store No]) over (Intersect([Store No],All([Date])))<>Count([Store No]) over (Intersect([Store No],[Date])),"Y")
这基本上是说如果当前行日期的商店编号的数量不等于所有日期的商店编号,则放置Y.