Page 1 of 1

Expressions in Report Designer

Posted: 10 Sep 2008, 11:34
by Loz
I am using v14 Sage Line 50 Professional. I am new to SAGE and am self taught.

I am trying to add a new calculated field to a PNL report to show the number of units sold as well as the balance. I added the expression (based on the CATEGORY.DISP_MTH1 field),
'PeriodAggregate("STOCK.QTY_SOLD_MTH", CRITERIA.TRAN_PERIOD_FROM, CRITERIA.TRAN_PERIOD_TO)'

but I get an error message saying STOCK.QTY_SOLD_MTH1 does not exist. However, when I just add STOCK.QTY1_SOLD_MTH1 as a field, it does show the value stored in that field (so does exist!). I get around it by having the expression
'STOCK.QTY_SOLD_MTH1+STOCK.QTY_SOLD_MTH2+STOCK.QTY_SOLD_MTH3+STOCK.QTY_SOLD_MTH4+STOCK.QTY_SOLD_MTH5+STOCK.QTY_SOLD_MTH6+STOCK.QTY_SOLD_MTH7+STOCK.QTY_SOLD_MTH8+STOCK.QTY_SOLD_MTH9+STOCK.QTY_SOLD_MTH10+STOCK.QTY_SOLD_MTH11+STOCK.QTY_SOLD_MTH12'
and this does give the total, but of course would not take notice of the period from/to criteria.

I added the STOCK table in the Data joins as a Left Join with NOMINAL_LEDGER

Can anyone shed any light on why the PerdiodAggregate function does not appear to work in this instance ? Have I missed a parameter somewhere ?

Thankyou

Sorted !

Posted: 10 Sep 2008, 13:32
by Loz
I think I have finally got this working !

I added a new expression field called UNITS by using the toolbox AND the former field I created called STOCK.QTY_SOLD_MTH1 was still there (see above), but when I deleted this former field, it errored again, so having this variable as a field on the report as well as the expression seems to be the missing link. I then hid it (visible=false).

All seems to be working fine now