问题
Hi I have two tables with same column . First I need to take 1 column value from table 1 then I need to search for value weather is exists in same column of table 2. can anybody know how to do this in spotfire?
回答1:
One way to do this is to attempt a join and then perform some logic on the join results. Below is how I would do this:
- Create a Calculated Column in Table2 named EXISTS with the expression of
TRUE
. - Go to Insert>Columns and choose to add columns to Table1 from Table2.
- Match on your primary key (in my case the column "LETTER")
- 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. - 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).
来源:https://stackoverflow.com/questions/29842975/how-to-search-table1-column-value-is-present-in-table2-column-or-not-in-spotfire