We have a bill book Notes app which contains “bill” and “feebudget” documents. There is one feebudget doc per client and 0 to any number of bills.
I am trying to create a view by client that shows whether we are ahead of or behind budget.
It is categorized by client code.
I have a column for bills to date (formula = BBTOTAL) which is totalled.
I have a column for budget, also totalled, with formula:
mth=@Month(@Now);
@If(mth=4;FBapr;mth=5;FBmay;mth=6;FBjun;mth=7;FBjul;mth=8;FBaug;mth=9;FBsep;mth=10;FBoct;mth=11;FBnov;mth=12;FBdec;mth=1;FBjan;mth=2;FBfeb;FBmar)
These work just fine - I can see total bills and budget to date by client! so what is the problem?
I need to subtract, effectively at total level, one from the other to get the under/over budget. So I created another totalled column with formula:
mth=@Month(@Now);
budg=@If(mth=4;FBapr;mth=5;FBmay;mth=6;FBjun;mth=7;FBjul;mth=8;FBaug;mth=9;FBsep;mth=10;FBoct;mth=11;FBnov;mth=12;FBdec;mth=1;FBjan;mth=2;FBfeb;FBmar);
@If(@IsAvailable(BBTOTAL);BBTOTAL;0)-@If(form=“Feebudget”;budg;0)
To my mind, at document level, this should pull out the bill value BBTOTAL if the doc is a bill (and it does) and should pull out the budget value if the doc is a budget (it doesn’t), and thus effectively create the difference at column-total level. It fails with “incorrect data type for operator or @function” on every feebudget doc… yet the budget formula in its own column works ok!
???
what am I doing wrong?