ERROR SUM AND IFF

HI, I'M TRYING USE THIS CODE:
BUT RETURNED AN ERROR.
Memo1: Erro na express??o 'IFF([DBLAN."IN_M"] = 'A', [SUM(<DBLAN."VL_M">,DetailData1)], '0')': Identifier expected
WHAT AM I DOING WRONG?
SORRY FOR MY BAD ENGLISH;
[IFF([DBLAN."IN_M"] = 'A', [SUM(<DBLAN."VL_M">,DetailData1)], '0')]
BUT RETURNED AN ERROR.
Memo1: Erro na express??o 'IFF([DBLAN."IN_M"] = 'A', [SUM(<DBLAN."VL_M">,DetailData1)], '0')': Identifier expected
WHAT AM I DOING WRONG?
SORRY FOR MY BAD ENGLISH;
Comments
too many [] in the expression
use the builtin expression builder to build your expression
try this
[iif((<DBLAN."IN_M">= 'A"),(SUM(<DBLAN."VL_M">,DetailData1)),'0')]
or use the builtin expression builder to build your expression it will set the correct braces for you
Simply remember, there must only ever be one set of [] brackets in an expression.
But the calculation is not correct.
Eg: Master data
Order N??: 100
Detail data
Name Product Qty Price State
Product x 1 10,00 A
Product y 1 20,00 C
Product z 1 8,00 A
Footer
Grand Total: 38,00
The sum does not match.
The total should be: 18,00
Thanks for the help!
not sure I understand the question, but,
the command is in a memo in footer
what you need to do is to create a variable initialize it to zero before the detailbands start to print
either in a detailheader or the masterdataband.
in the obp event of detailband add the values according to the test field value
if <DBLAN."IN_M" = 'A" myvarname :=myvarname + <datasetname."valuefieldname">;
use the variable in the memo in the footer.
thanks for your help and attention!