<p>You can get the total amount of rows like this: </p>

<pre><code>{% set totalcount = 0 %}
{% for entry in entries %}
    {% set totalcount = totalcount + entry.artikelnummer|length %} 
{% endfor %}
</code></pre>

<p><strong>Edit</strong></p>

<p>In the loop you add the length to the totalCount.</p>

CC BY-SA 3.0
2017-01-27T22:06:51.370Z
Thanks a lot! Had to add a `{% set totalcount = 0 %}` outside the loop and it worked!
TomS
CC BY-SA 3.0
2017-01-27T23:25:07.810Z
@TomS I'll edit the answer so it's more clear for everyone ;)
Jan_dh
CC BY-SA 3.0
2017-01-27T16:09:30.953Z
2017-01-27T23:25:35.713Z
2017-01-27T23:25:35.713Z
Jan_dh
<p>I would like to know, how many values are saved in the table field called "artikelnummer" with the field name "artikel". The section is called "bikes". I tried:</p>

<pre><code>{% set entries = craft.entries.section('bikes') %}

{% for entry in entries %}
  {% for row in entry.artikelnummer %}
    {{ row.artikel|length }}
  {% endfor %}
{% endfor %}
</code></pre>

<p>Thanks!</p>

CC BY-SA 3.0
2017-01-27T16:40:31.093Z
`{{ row.length }}` gives me Key "length" for array with keys "col1, artikel" does not exist error. {{entry.artikelnummer|length}} gives me: 2 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 1 1 0 1 2 1 0 1 1 2. I need the sum of them.
TomS
CC BY-SA 3.0
2017-01-27T18:40:39.547Z
sorry, misread your question. updated the answer
Jan_dh
<sections><table-field><count>
Count table field values in certain section
# Count table field values in certain section

(Asked by: username_0 on 2017-01-27)

I would like to know, how many values are saved in the table field called "artikelnummer" with the field name "artikel". The section is called "bikes". I tried:
{% set entries = craft.entries.section('bikes') %}

{% for entry in entries %}
  {% for row in entry.artikelnummer %}
    {{ row.artikel|length }}
  {% endfor %}
{% endfor %}

Thanks!

**Tags:** sections, table-field, count

> **Comments:**
> **username_0**: `{{ row.length }}` gives me Key "length" for array with keys "col1, artikel" does not exist error. {{entry.artikelnummer|length}} gives me: 2 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 1 1 0 1 2 1 0 1 1 2. I need the sum of them.  
> **username_1**: sorry, misread your question. updated the answer  

---

## 1 answers

### Answer by username_1 on 2017-01-27. Score: 2 | Accepted answer

You can get the total amount of rows like this: 
{% set totalcount = 0 %}
{% for entry in entries %}
    {% set totalcount = totalcount + entry.artikelnummer|length %} 
{% endfor %}

Edit
In the loop you add the length to the totalCount.

> **Comments:**
> **username_0**: Thanks a lot! Had to add a `{% set totalcount = 0 %}` outside the loop and it worked!  
> **username_1**: @username_0 I'll edit the answer so it's more clear for everyone ;)  

---

