# Total number of share

**URL:** <https://community.silverfin.com/t/total-number-of-share/1455>\
**Category:** Templates\
**Created:** [April 8, 2019, 1:05pm UTC](https://community.silverfin.com/t/total-number-of-share/1455 "2019-04-08T13:05:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylvia.debaeremaeker](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sylvia.debaeremaeker](https://community.silverfin.com/u/sylvia.debaeremaeker)\
**Post date:** [April 8, 2019, 1:05pm UTC](https://community.silverfin.com/t/total-number-of-share/1455/1 "2019-04-08T13:05:33Z")

</div>

Hi

I want to calculate the total number of shares, but only if the type of share is Volle eigendom or Naakte eigendom.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/97b3016e06b5efe2b374c3582e3459c48d06e3cc.png)  
I’ve tried with the code below, but this is not working.

{% for shareholder in period.shareholders%}{% $0+ shareholder.amount\_of\_shares %}{% endfor %}  
| **Totaal aantal aandelen**  
|{% if shareholder.custom.kind\_of\_shares == “Volle eigendom” or shareholder.custom.kind\_of\_shares == “Naakte eigendom” %}{{ $0 | integer }}{% endif %}

---

<div class="post-metadata">

**Author:** ![borjaGonzalez](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/borjagonzalez/32/825_2.png) [@borjaGonzalez](https://community.silverfin.com/u/borjaGonzalez)\
**Post date:** [April 8, 2019, 1:25pm UTC](https://community.silverfin.com/t/total-number-of-share/1455/2 "2019-04-08T13:25:51Z")

</div>

Hi Sylvia,

You could do the following:

```auto
{% for shareholder in period.shareholders%}
{% if shareholder.custom.kind_of_shares == “Volle eigendom” or shareholder.custom.kind_of_shares == “Naakte eigendom” %}
{% $0+ shareholder.amount_of_shares %}
{% endif %}
{% endfor %}
|Totaal aantal aandelen
|{{ $0 | integer }}

```

Let me know if that works.

Best,  
Borja

---

<div class="post-metadata">

**Author:** ![sylvia.debaeremaeker](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sylvia.debaeremaeker](https://community.silverfin.com/u/sylvia.debaeremaeker)\
**Post date:** [April 8, 2019, 1:30pm UTC](https://community.silverfin.com/t/total-number-of-share/1455/3 "2019-04-08T13:30:09Z")

</div>

> [@borjaGonzalez](#):
>
> {% for shareholder in period.shareholders%} {% if shareholder.custom.kind\_of\_shares == “Volle eigendom” or shareholder.custom.kind\_of\_shares == “Naakte eigendom” %} {% $0+ shareholder.amount\_of\_shares %} {% endif %} {% endfor %}

Hi Borja  
Yes, this seems to work  
Thx!

---

<div class="post-metadata">

**Author:** ![sylvia.debaeremaeker](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@sylvia.debaeremaeker](https://community.silverfin.com/u/sylvia.debaeremaeker)\
**Post date:** [April 8, 2019, 2:00pm UTC](https://community.silverfin.com/t/total-number-of-share/1455/4 "2019-04-08T14:00:45Z")

</div>

Borja

Apparently in some files, the type of shares is blank, so I added or shareholder.custom.kind\_of\_shares == " ", but then I don’t get a total.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/1X/d8dde21450646717674bdb8fd9241bc90c09096d.png)

{% for shareholder in period.shareholders%}  
{% if shareholder.custom.kind\_of\_shares == “Volle eigendom” or shareholder.custom.kind\_of\_shares == “Naakte eigendom” or shareholder.custom.kind\_of\_shares == “Nue-propriété” or shareholder.custom.kind\_of\_shares == “Pleine propriété” or shareholder.custom.kind\_of\_shares == " " %}  
{% $0+ shareholder.amount\_of\_shares %}  
{% endif %}  
{% endfor %}

---

<div class="post-metadata">

**Author:** ![borjaGonzalez](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/borjagonzalez/32/825_2.png) [@borjaGonzalez](https://community.silverfin.com/u/borjaGonzalez)\
**Post date:** [April 8, 2019, 4:50pm UTC](https://community.silverfin.com/t/total-number-of-share/1455/5 "2019-04-08T16:50:49Z")

</div>

Hi Sylvia,

It should be:

```auto
or shareholder.custom.kind_of_shares == blank

```

Best,  
Borja
