# Using account\_collection range:

**URL:** https://community.silverfin.com/t/using-account-collection-range/168
**Category:** Templates
**Created:** [March 27, 2017, 11:47am UTC](https://community.silverfin.com/t/using-account-collection-range/168 "2017-03-27T11:47:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![GMOONS](https://avatars.discourse-cdn.com/v4/letter/g/ce7236/32.png) [@GMOONS](https://community.silverfin.com/u/GMOONS)
#### Post date: [March 27, 2017, 11:47am UTC](https://community.silverfin.com/t/using-account-collection-range/168/1 "2017-03-27T11:47:32Z")

</div>

Dear,

I’ve the following code:

```auto
{% assign accounts_a = period.accounts | range: custom.accounts.a %}
{% ifi accounts_a != empty or custom.a != empty %}

|:-4%--|:-40%-------|--14%---:|:-12%---:|--13%--:|--13%---:|-4%--:+
{% stripnewlines %}
| {% unless accounts_a != empty or custom.a != empty %}{% input custom.non_deductible.taxes as:boolean default:'true' %}{% endunless %} 
| **{% t "Non deductible taxes" %}** {% input custom.accounts.a as:account_collection range:6,7 %}{% assign $1 = 0 %} 
|
|
|
|
|
{% endstripnewlines %}

{% if custom.non_deductible.taxes != 'false' %}

|:-4%--|:-40%-------|--14%---:|:-12%---:|--13%--:|--13%---:|-4%--:+{%for account in accounts_a %}
{% stripnewlines %}
|
|{% ic %}&nbsp;&nbsp;{% endic %}{{ account.number }} {{ account.name }}
|{%=$1+ account.value %}
|
|
|
|
{% endstripnewlines %}{% endfor %

```

Now I would like to code that the range is not allowed to be 6,7 if the accounts are not in BE GAAP.  
Therefore I would like to code sth like:  
{% if company.custom.specific.resident == “Resident” %}  
{% assign range = 6,7 %}  
{% elseif company.custom.specific.resdient== ‘"Non-resident’%}  
NO RANGE  
{% endif %}

How can I do this properly?

Thanks in advance,

Kind regards,

Glenn

---

<div class="post-metadata">

### Author: ![GMOONS](https://avatars.discourse-cdn.com/v4/letter/g/ce7236/32.png) [@GMOONS](https://community.silverfin.com/u/GMOONS)
#### Post date: [March 29, 2017, 7:31am UTC](https://community.silverfin.com/t/using-account-collection-range/168/2 "2017-03-29T07:31:52Z")

</div>

Has anyone an idea? Because I’m kind of stuck.
