I am trying to create a formula to calculate the total of all invoices for a vendor (but not yet cleared) when an invoice for that vendor is posted. I am using SAP data, and trying to calculate using data from the BSEG table. I am displaying this total in an OLAP table in an analysis. I am passing in the posting date of the current invoice as a parameter ({p1}). The result displayed is the vendor invoice total for all invoices, for all records.
PU_SUM("LFA1", "BSEG"."WRBTR", ("BSEG"."BUDAT" <= {p1}) AND ("BSEG"."AUGDT" >= {p1}))
The Vendor Master table (LFA1) and the Invoice Line Item table (BSEG) are linked in the data model via MANDT (Client) and LIFNR (Vendor ID).
Whatever help you can provide would be greatly appreciated.