简体   繁体   English

Spotfire中特定值的相邻单元格的计算列

[英]Calculated Column for Adjacent Cells of a Specific Value in Spotfire

I am wondering if it is possible to create a calculated column that will count how many cells of the same value (and only this value) are successive (ie, next to each other) so that I can divide it by the total number of cells in that column. 我想知道是否有可能创建一个计算列,该列将计算有多少个相同值(仅此值)的连续单元(即,彼此相邻),以便我可以将其除以单元总数在该列中。 Any help or advice would be greatly appreciated as I've been scratching my head over this for a while. 任何帮助或建议都将不胜感激,因为我已经为此努力了一段时间。 This is an update to a previous question I posted (link below) 这是我之前发布问题的更新(下面的链接)

This new question has the key differences below: (1) I only want to count the number of "Blue" cells that are adjacent to other "Blue" cells (2) I would like to do this for (over) each Site 这个新问题的主要区别如下:(1)我只想计算与其他“蓝色”单元格相邻的“蓝色”单元格的数量(2)我想针对每个站点(超过)执行此操作

在此处输入图片说明

Previous question is here: Number of Successive Cells of a Same Value in Spotfire 上一个问题在这里: Spotfire中相同值的连续单元数

You'll need to insert your RowID column again, but after that this formula will work for you. 您将需要再次插入RowID列,但此后此公式将为您工作。 You can test by making SiteB, Depth 1 = Blue so that you have two "Blues" touching that are in different sites. 您可以通过使SiteB的深度1 =蓝色来进行测试,以便使两个“蓝色”触摸到不同的站点。

If(([Color]="Blue") and 
(([Color]=First([Color]) over (Intersect([Site],Next([rid]))))
or
([Color]=First([Color]) over (Intersect([Site],Previous([rid]))))),1,0)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM