# Unreconciled + If statement

**URL:** <https://community.silverfin.com/t/unreconciled-if-statement/2166>\
**Category:** Templates\
**Tags:** unreconciled, if\
**Created:** [October 20, 2021, 11:30am UTC](https://community.silverfin.com/t/unreconciled-if-statement/2166 "2021-10-20T11:30:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zena](https://avatars.discourse-cdn.com/v4/letter/z/e47c2d/32.png) [@Zena](https://community.silverfin.com/u/Zena)\
**Post date:** [October 20, 2021, 11:30am UTC](https://community.silverfin.com/t/unreconciled-if-statement/2166/1 "2021-10-20T11:30:57Z")

</div>

Hi everyone

I want to use an unreconciled tag in combination with an IF statement.

This is my IF statement:

{%if maxturnover \> maxwage %}{{ maxwage | currency}} {% endif %} {% if maxturnover \< maxwage %}{{ maxturnover | currency}} {% endif %}

I tried this:  
{% if maxturnover \> maxwage %}  
{% unreconciled maxturnover %}  
{% endif %}

{% if maxturnover \< maxwage %}  
{% unreconciled maxwage %}  
{% endif %}

→ in these both cases the template is reconciled and can turn green.  
In all other cases it needs to be red.  
But this doesn’t work - the template is always green.

Can someone help me out on how to get these 2 together?

---

<div class="post-metadata">

**Author:** ![t0gden](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/t0gden/32/1842_2.png) [@t0gden](https://community.silverfin.com/u/t0gden)\
**Post date:** [October 20, 2021, 4:07pm UTC](https://community.silverfin.com/t/unreconciled-if-statement/2166/2 "2021-10-20T16:07:05Z")

</div>

Hi Zena,

Thank you for reaching out.

When the formula within an unreconciled tag has **zero** as an outcome (not to be mistaken for empty), the template will be fully reconciled and a green dot will be visible at the template level otherwise you will see a red triangle.

In order to test your code, I have assigned temporary values to the “maxturnover” & “maxwage” variables.

I have separated the **IF** statement and the declaration of the **unreconciled** tag from one another.

I have assigned a variable “ **unreconciled\_value** ” to **0**.

I have also added some optional code that will add an indicator and text to show why it is not reconciled (hover over the red triangle to see the text).

In my test the code is now working.

```auto
{% assign unreconciled_value = 0 %}

{% if maxturnover > maxwage %}
  {% assign unreconciled_value = maxturnover%}
{% endif %}

{% capture unreconciled_text_to_show %}Unreconciled value is {{ unreconciled_value | currency }}{% endcapture %}
{% unreconciled unreconciled_value as:indicator unreconciled_text:unreconciled_text_to_show %}

```

I hope this helps but if you need further help you can refer to this link \> [Unreconciled](https://developer.silverfin.com/docs/unreconciled)

Alternatively, please could you provide me with some more detail on your code and I will be happy to help.

Many thanks

Tom

---

<div class="post-metadata">

**Author:** ![Zena](https://avatars.discourse-cdn.com/v4/letter/z/e47c2d/32.png) [@Zena](https://community.silverfin.com/u/Zena)\
**Post date:** [November 19, 2021, 11:53am UTC](https://community.silverfin.com/t/unreconciled-if-statement/2166/3 "2021-11-19T11:53:06Z")

</div>

> [@t0gden](#):
>
> ```auto
> {% assign unreconciled_value = 0 %}
> 
> {% if maxturnover > maxwage %}
> {% assign unreconciled_value = maxturnover%}
> {% endif %}
> 
> {% capture unreconciled_text_to_show %}Unreconciled value is {{ unreconciled_value | currency }}{% endcapture %}
> {% unreconciled unreconciled_value as:indicator unreconciled_text:unreconciled_text_to_show %}
> 
> ```

Hi Tom

Thanks for your reply, but it still does not work. I have gotten a step closer, but still not what I want/need.

Your code works, but we if maxturnover \< maxwage? If I copy the code and change the \>\< it still does not work.

I have tried:  
{% assign unreconciled\_value = 0 %}

{% if maxturnover \> maxwage %}  
{% assign unreconciled\_value = maxturnover%}  
{% endif %}

{% capture unreconciled\_text\_to\_show %}Unreconciled value is {{ unreconciled\_value | currency }}{% endcapture %}  
{% unreconciled unreconciled\_value as:indicator unreconciled\_text:unreconciled\_text\_to\_show %}

{% assign unreconciled\_value = 0 %}

{% if maxturnover \< maxwage %}  
{% assign unreconciled\_value1 = maxwage%}  
{% endif %}

{% capture unreconciled\_text\_to\_show %}Unreconciled value is {{ unreconciled\_value1 | currency }}{% endcapture %}  
{% unreconciled unreconciled\_value1 as:indicator unreconciled\_text:unreconciled\_text\_to\_show %}

---

<div class="post-metadata">

**Author:** ![Michiel](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/michiel/32/2364_2.png) [@Michiel](https://community.silverfin.com/u/Michiel)\
**Post date:** [November 22, 2021, 3:11pm UTC](https://community.silverfin.com/t/unreconciled-if-statement/2166/4 "2021-11-22T15:11:12Z")

</div>

Hi @Zena ,

I’m not sure what is currently blocking you? What exactly is not working? Have you printed maxturnover and maxwage as a test? Are these actual values or do they have a corrupt value, e.g. blank?

Also, based on your code I would think that two unreconcile indicators are shown, is this your desired outcome?

Kind regards,

Michiel
