{# QC thresholds + flag-count breakdown — the `qc` panel payload (kind="table"). #} {% if qc_thresholds %}

Thresholds applied (as stored in stage 3 file)

{% for row in qc_thresholds %} {% endfor %}
Variable Test Suspect range / threshold Fail range / threshold
{{ row.var }} {{ row.test }} {{ row.suspect }} {{ row.fail }}
{% endif %}

Flag counts

{% for row in qc_summary %} {% set good = row.flags | selectattr("flag", "eq", 1) | first %} {% set susp = row.flags | selectattr("flag", "eq", 3) | first %} {% set bad = row.flags | selectattr("flag", "eq", 4) | first %} {% set interp = row.flags | selectattr("flag", "eq", 8) | first %} {% set miss = row.flags | selectattr("flag", "eq", 9) | first %} {% endfor %}
Variable N Good % Suspect % Bad % Interp. % Missing % Distribution
{{ row.var }} {{ "{:,}".format(row.total) }} {{ good.pct }} {% if susp.n > 0 %}{% if susp.pct > 0 %}{{ susp.pct }}{% else %}<0.1% ({{ susp.n }}){% endif %}{% else %}–{% endif %} {% if bad.n > 0 %}{% if bad.pct > 0 %}{{ bad.pct }}{% else %}<0.1% ({{ bad.n }}){% endif %}{% else %}–{% endif %} {% if interp.n > 0 %}{% if interp.pct > 0 %}{{ interp.pct }}{% else %}<0.1% ({{ interp.n }}){% endif %}{% else %}–{% endif %} {% if miss.n > 0 %}{% if miss.pct > 0 %}{{ miss.pct }}{% else %}<0.1% ({{ miss.n }}){% endif %}{% else %}–{% endif %}
{% for f in row.flags %}{% if f.pct > 0 %}
{% endif %}{% endfor %}