spotfire:搜索另一个表的列 [英] spotfire: search a column of another table

查看:126
本文介绍了spotfire:搜索另一个表的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Spotfire中创建计算列,在该列中,在分配新值之前,必须在另一个表的列中显示特定值。

I'm trying to make a calculated column in Spotfire, where a specific value has to be present in a column of another table before a new value is assigned.

我的表情如下:

If(Find('Specific value first table',**'present in second table'**) is Null, 0, 'New Value')

我不知道如何在搜索中包含第二张表,有人知道吗?

I have no idea how to involve this second table in my search, does anyone has any idea?

谢谢!

推荐答案

您将无法在创建计算列时引用另一个表。但是,我认为我们可以完全解决您的问题。

You won't be able to reference another table when creating a calculated column. However, I think we can solve your problem all the same.

您想要做的是尝试通过加入包含您的值的列来插入其他表中的列正在搜索,然后使用简单的计算列检查它是否存在。您需要将空值设置为新值,并保留现有值。类似于的情况,当[new_column]为null则为'new_value',否则[new_column]结尾

What you'll want to do is attempt to insert columns from your other table by joining on the column that holds the values you're searching for and then check if it exists with a simple calculated column. In your case you'll want to set the null values as your new value and keep the existing values. Something like case when [new_column] is null then 'new_value' else [new_column] end.

以下是先前的类似内容,但略有不同为方便起见,我用下面的答案回答了另一个问题。

Below is a previous similar but slightly different question I answered with my answer copied below for convenience.

如何搜索Table1列的值在Spotfire中是否存在于Table2列中?


  1. 在表2中创建一个名为EXISTS的计算列,其表达式为 TRUE

  2. 转到Insert> Columns,然后选择从Table2向Table1添加列。

  3. 匹配主键(在我的情况下为 LETTER列)

  4. 从复选框中选择EXISTS以添加并使用左单个匹配的Join方法,以保留记录数并点击Finish。

  5. 现在在Table1中有一个名为EXISTS的列为null或TRUE。如果您希望它为TRUE或FALSE,则可以基于它创建一个计算列,以评估它是否为NULL: [EXISTS] Is Not Null 。我将其命名为 EXISTS_TF在下面的示例中。

  1. Create a Calculated Column in Table2 named EXISTS with the expression of TRUE.
  2. Go to Insert>Columns and choose to add columns to Table1 from Table2.
  3. Match on your primary key (in my case the column "LETTER")
  4. Select EXISTS from the checkboxes to add and use the Join method of Left single match in order to preserve your number of records and hit Finish.
  5. Now you have a column named EXISTS in your Table1 that is either null or TRUE. If you would like to have it be TRUE or FALSE you can create a calculated column based upon it that evaluates if it's NULL or not like so: [EXISTS] Is Not Null. I named mine "EXISTS_TF" in the example below.

我的数据和上面后面的结果列:

My data and resulting columns after the above:

您现在应该能够根据新列进行过滤和计算)。

You should now be able to filter and do calculations based on your new column(s).

这篇关于spotfire:搜索另一个表的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆