CASE: account range

Some of our code uses the range attribute to define the account range.

i.e.

{% assign accounts = period.accounts | range:"20" %}
{% input custom.some.thing as:account_collection range:44 %}

In this case we show the ways this range can be defined

Range:4

When using a single number (i.e. 4) all accounts starting with a 4 will be selected (from 400000 to 499999)


Range:40,44

In this case all accounts starting with 40 or 44 will be selected, this means all accounts from 400000 to 409999 and all accounts from 440000 to 449999.


Range:40__44

Defining your range like this will make sure that all accounts from 400000 to 449999 are selected


Range:40,54__58,491,493

Ofcourse it’s possible to combine several of these methods
In this case, all 40 accounts (400000 to 409999), all accounts from 540000 to 589999, all accounts from 491000 to 491999 and finally also the accounts from 493000 to 493999 are selected.


That wraps it up.
If you still have questions about this subject, you can always ask them here.

I use this code:
{% assign accounts = period.accounts | range:30,31 %}
and I get this error message:
Liquid error (line 36): wrong number of arguments (given 3, expected 2)
What I am doing wrong?

Tx

Ward D

Hi Warde

When using multiple ranges with a “| range:” you have to put them between quotes.

{% assign accounts = period.accounts | range:“30,31” %

Thanks for pointing this out!

Kind regards

Sam

Ok, tx, this works indeed!

@SamVanEenoo Is there any way to define an account range in a balance report, indicating exhaustively which accounts should be present in the report?

Eg: range:“65” => Show only “65”, not “651, 652,…”

In our use case, we’d like to add the 65-accounts to the header without further categorisation, but if there would be a category, we add them to the category. Eg:

65
<all 65-accounts> => Only 65, how to do this?
651
<all 651x-accounts> => this is ok
652
<all 652x-accounts> => this is ok

Hi there,

You can try using 65$ if what you want is that unique account as in the case explained below:

Hope that works for you.

Best,
Borja

Thanks! It doesn’t appear to work in a report though, is this functionality template-only? Or is there a way to use it in a report as well? I don’t see this functionality listed in the docs

Hi Wim,

Where did you allocate the range in your report? Are you using formulas? If you just want to get the value os that specific account it might be work just to use the drag and drop functionality as in the image below:

Best,
Borja