{% assign accounts = period.accounts %}
{% assign py_accounts = period.minus_1y.accounts %}
{% stripnewlines %}
|
| {{period.year_end_date}}
| {{period.minus_1y.year_end_date}}
{% newline %}
|----80%----
|----10%—:
|----10%—:
{% if accounts[“4000.123”]!=0 and py_accounts[“4000.123”]!=0 %}
{% newline %}
| Test Account 1
| {{accounts[“4000.123”]}}
| {{py_accounts[“4000.123”]}}
{% else %}{% endif %}
{% if accounts[“1”]!=0 and py_accounts[“1”]!=0 %}
{% newline %}
| Test Account 2
| {{accounts[“1”]}}
| {{py_accounts[“1”]}}
{% else %}
{% endif %}
{% endstripnewlines %}
I wrote the above code as a test to see if it was possible to hide a row in which both the current year and prior year values were 0, and this is the result I got (failure )
Any ideas on how to solve this problem? I was thinking potentially using a forloop with arrays to populate rows and an if statement saying 'if account!=0 then show row else don’t show row endif within the forloop – but that is essentially the same code as above. What I would need is a way to reference a column. In forloop, you can use forloop.index to reference a row, but I am unsure how to reference a column.
Since CY value is in column #2 and PY value is in column #3, something like ‘if forloop.columnindex !=0 and forloop.columnindex1!=0 then show else don’t show endif’.
I know this code doesn’t exist but if that was understandable, is there some existing logic that can be used to achieve my goal?
Thank you - Spencer