# Sort template 'eigen vermogen' on date

**URL:** <https://community.silverfin.com/t/sort-template-eigen-vermogen-on-date/242>\
**Category:** Templates\
**Tags:** tables\
**Created:** [May 9, 2017, 4:59pm UTC](https://community.silverfin.com/t/sort-template-eigen-vermogen-on-date/242 "2017-05-09T16:59:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Andrew](https://community.silverfin.com/u/Andrew)\
**Post date:** [May 9, 2017, 4:59pm UTC](https://community.silverfin.com/t/sort-template-eigen-vermogen-on-date/242/1 "2017-05-09T16:59:12Z")

</div>

Question…

This is the code of the reconciliation of ‘eigen vermogen’ in ‘standaardsjablonen’.

Is it possible to sort the lines on date ? I think I have to put some something between addnewinputs and endaddnewinputs ? {% assign lijnen = custom.lijnen %} and then sort, but sort on which variable ?

Thx for the answer!

```auto
{% t= "Totaal" fr:"Total" en:"Total" %}
{% t= "Datum" fr:"Date" en:"Date" %}
{% t= "Boekhouding" fr:"Comptabilité" en:"Bookkeeping" %}
{% t= "Aantal aandelen" fr:"Nombre d'actions" en:"Number of shares" %}
{% t= "Intrinsieke waarde per aandeel" fr:"Valeur intrinsèque par action" en:"Intrinsic value of the shares" %}

{% addnewinputs %}
{% assign lijnen = custom.lijnen %}
{% endaddnewinputs %}

|{% input custom.accounts.range as:account_collection range:1 default:10,11,12,13,14,15 accounts_var:accounts%}{% assign accounts = accounts.include_zeros %}| {% t "Datum" %} {% for account in accounts %}| {% linkto account %}{{account.number}}{% endlinkto %}<br>{{account.name}}{% endfor %}| {% t "Totaal" %}
|---|------{% for account in accounts %}|------:{% endfor %}|-----:+{% fori l in lijnen %}{% assign $0 = 0 %}
|{% input l.omschrijving %} {% input l.doc as:file size:mini %}|{% input l.datum as:date %}{% for account in accounts %}|{%$0+input l[account.number] as:currency placeholder:"" %}{% endfor %}|{%=$1+ $0 %}{% endfori %}
| **{% t "Totaal" %}** | {% for account in accounts %}{% assign $0 = 0 %}|{% for l in lijnen %}{%$0+ l[account.number] %} {% endfor %}{% unexplained account.value+$0 as:indicator %} **{{ $0 | currency }}** {% assign $0 = 0 %}{% endfor %}| **{{ $1 | currency }}** {% ic %}
| {% t "Boekhouding" %} | {% for account in accounts %}|{%=$20+ -1*account.value %}{% endfor %}| **{{ $20 | currency }}** {% endic %}

|---------25%-----|-----------+
|
| {% t "Aantal aandelen" %} | {% input custom.aantal.aandelen %}
| {% t "Intrinsieke waarde per aandeel" %} | {{ -1*accounts.value/custom.aantal.aandelen | currency }}

```

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [May 9, 2017, 6:27pm UTC](https://community.silverfin.com/t/sort-template-eigen-vermogen-on-date/242/2 "2017-05-09T18:27:04Z")

</div>

Hi @Andrew,

You are almost correct.

The answer lies in this code :

```auto
{% addnewinputs %}
{% assign details = current_account.details | sort:'date' %}
{% endaddnewinputs %}

```

That’s just an example of how we sort every input for our template “rekening courant”. That template has a collection of inputs (called ‘details’) and one of those inputs is a variable ‘date’).

In your case, you’ll have to assign ‘lijnen’ to a new variable and sort it on a certain variable (datum).

Could you give it a try?

---

<div class="post-metadata">

**Author:** ![Andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Andrew](https://community.silverfin.com/u/Andrew)\
**Post date:** [May 11, 2017, 7:03pm UTC](https://community.silverfin.com/t/sort-template-eigen-vermogen-on-date/242/3 "2017-05-11T19:03:12Z")

</div>

> [@sven](#):
>
> details = current\_account.details | sort:‘date’ %}

I gave it a try, but I dont find the variable I have to assign ‘lijnen’ to …

Can you help me with that ?

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [May 12, 2017, 12:14pm UTC](https://community.silverfin.com/t/sort-template-eigen-vermogen-on-date/242/4 "2017-05-12T12:14:07Z")

</div>

Sure thing @Andrew.

The only code you need to adjust is this :

```auto
{% addnewinputs %}
{% assign lijnen = custom.lijnen | sort:'datum' %}
{% endaddnewinputs %}

```

Hope you’ll understand how it works? If not, just let it know.
