title: Spotfire: add column with values based on marking in another table
body: <p>In Spotfire I have two tables "A" and "B" with a shared column "id". Let x be the set of "id" values of the marked rows in A. I would like to add a new column "flag" to B such that:</p>
  
  <ul>
  <li>flag = 1 if B.id is in x</li>
  <li>flag = 0 otherwise</li>
  </ul>
  
  <p>Can somebody help me put together a script (IronPython, I guess), to achieve this? Here's an example (the columns a, b, c and x, y, z don't matter):</p>
  
  <pre><code>   A: id a b c
        1*  
        2 
        2*
        3
        3  
  </code></pre>
  
  <p>(* indicate marked rows)</p>
  
  <pre><code>   B: id x y z
         1
         1
         2
         2
         2
         3
         3
  </code></pre>
  
  <p>should result in:</p>
  
  <pre><code>   B: id x y z flag
         1       1 
         1       1 
         2       1
         2       1
         2       1
         3       0
         3       0
  </code></pre>