Division operator in custom report formulas

Continuing the discussion from Can't get divide function to work in report formula:

I’ve just run up against this issue too. I’m trying to come up with a report that will show me my sales VAT collected as a proportion of total gross turnover, so I can track whether at any point it would be worth considering moving onto the flat rate scheme. So the formula would be

2200 / (2200 + 4000:4999)

This does actually work correctly, but I had to prepare the formula in a text editor and then copy-paste it into the formula box in order to get around the form field validator which does not allow the / character to be typed into the formula box.

The “examples” pop up on the custom report creation page suggests that division is a valid operator, so would you consider adding / as a valid character (i.e. add 47 as an option in the keypress handler)?

That’s a very useful formula :smile:

Let me try this on a test account and see if we can relax the validation.

EDIT:

@ian_roberts

The forward slash character has now been white-listed. Although it won’t go live until the next release.

I’m wondering given what you’re trying to do here if it’s possible for us to just add an additional button on the return itself to “Simulate Flat Rate VAT”. I can’t imagine this being hard, but we’d need to take a closer look.

My formula is a bit of a hack, and it will blow up for date ranges that include a VAT return submission, but it’s a useful rough estimate if you look at the bar chart view on week granularity and ignore any weeks that include a VAT return journal. Ideally you’d want to consider just the (many small) credit entries on 2200 created by sales invoices and not count the (occasional large) debits created by the VAT return.