title: Dynamic Computation in Tableau based on User Input
body: <p>I have a requirement to dynamically perform computations in Tableau based on User Input.</p>
  
  <p>For this purpose my basic query looks something like this:</p>
  
  <pre><code>Select some_dimension,sum(some_measure)/count(some_measure) as 
  some_measure_average
  from table
  where date = User_Input
  group by some_dimension
  </code></pre>
  
  <p>The User_Input value should be passed based on what the user has selected and the corresponding computation should be performed based on the above query logic.Here , the Custom SQL should hit the connected Database that contains the data and display the computed data on Tableau.</p>
  
  <p>Here the average is calculated based on the division of sum and count and should only be computed for the date value that has been selected.</p>
  
  <p>The Custom SQL Query option in Tableau is not able to fulfill this requirement.
  Not sure if we are doing it correctly.</p>