title: How to make a random sampling of 20% of records in Tableau?
body: <p>In Tableau 9.2, is it possible to generate a random sample of records?  If so, how could I do this?  Say I have a field called Field1, then I intend to only select 20% of the records.  So far, I have <a href="https://community.tableau.com/docs/DOC-1474" rel="nofollow">found</a> how to a generate random integer in Tableau, though it is bewildering that Tableau <a href="https://community.tableau.com/ideas/2046" rel="nofollow">does not</a> already have a function for this:</p>
  
  <p><strong>Random Seed</strong></p>
  
  <pre><code>(DATEPART('second', NOW()) + 1) * (DATEPART('minute', NOW()) + 1) * (DATEPART('hour', NOW()) + 1) * (DATEPART('day', NOW()) + 1)
  </code></pre>
  
  <p><strong>Random Number</strong></p>
  
  <pre><code>((PREVIOUS_VALUE(MIN([Seed])) * 1140671485 + 12820163) % (2^24))
  </code></pre>
  
  <p><strong>Random Int</strong></p>
  
  <pre><code>INT([Random Number] / (2^24) * [Random Upper Limit]) + 1
  </code></pre>
  
  <p>So how could I create a calculated field to only show random records that make up 20% of Field1?</p>