title: Store result of a query in a variable ( jinja)
body: <p>I am trying to put the result of a query in a variable but it doesn't work.
  I am not sure what to do so it returns 0 as expected. Any ideas? I am using dbt and jinja.
  With the below code the <strong>results_list</strong> variable is <code>(Decimal('0'),))</code></p>
  <p><strong>MACRO</strong></p>
  <pre><code>{% macro source_freshness(model, column_name) %}
  {% set freshness_query %}
  SELECT COUNT 0 AS count
  {% endset %}
  
  {% set results = run_query(freshness_query) %}
  
  {% if execute %}
  {% set results_list = results.columns[0].values() %}
  {% else %}
  {% set results_list = [] %}
  {% endif %}
  
  {{ return(results_list) }}
  
  {% endmacro %}
  </code></pre>
  <p>call in a <strong>model</strong>:</p>
  <pre><code>{% set freshness_query_test = source_freshness(ref('model'),'date') %}
  
  {% if count in freshness_query_test == 0 %}
  do this
  {% else %}
  do that
  {% endif %}
  </code></pre>
  <p>Thank you!</p>