title: Creating calculated columns based on where
body: <p>I am trying to create calculated fields for a workflow that I will export to an excel pivot table.  I am doing this by creating a view and selecting columns from another table while creating extra necessary columns.</p>
  
  <p>I am faced with the task of populating rows within a column based on a calculation only when rows of another column equal a certain value.  I have tried different variations of the below formula to no avail.</p>
  
  <pre><code>CREAT MATERIALIZED VIEW adwords_calculated AS
  SELECT SUM("Impressions" * 1 ) WHERE AD Relevance = 
  "Positive Ad Relevance" AS Positive Ad Impressions
  </code></pre>
  
  <p>Please let me know if anything within this formula is unclear.</p>