title: Union of masked values
body: <p>I've got a problem with making union of 2 tables that have values masked using random function. Unless someone has permission to read all data, user should see random values between (-1000,2000)</p>
  
  <p>making separate views for each table generates the values in a correct way, however there's problem when I try to make union of those 2 tables or views. Instead of seeing random values I see 0 for everything</p>
  
  <p>Let's say there's table A defined as:</p>
  
  <pre><code>ID      INT       IDENTITY (1, 1) NOT NULL,
  Value   MONEY     MASKED WITH (FUNCTION = 'random(-1000, 20000)') NOT NULL
  </code></pre>
  
  <p>and table B as:</p>
  
  <pre><code>ID      INT       IDENTITY (1, 1) NOT NULL,
  Value   DECIMAL   (18, 6) MASKED WITH (FUNCTION = 'random(-1000.000000, 20000.000000)') NULL
  </code></pre>
  
  <p>in table A:</p>
  
  <pre><code>ID   Value
  1     12
  2     21
  3     34
  </code></pre>
  
  <p>in table B:</p>
  
  <pre><code>ID   Value
  7     17.12
  8     23.01
  9     2.56
  </code></pre>
  
  <p>view on each of table shows ID's of each tables and masked values for user without permissions and values as in table for user with permissions which is correct</p>
  
  <p>however UNION of both tables should show ID's and masked values but instead it shows values = 0.000000.</p>
  
  <p>I'm kinda confused on how to make those values appear as masked random values in union </p>