FineReport Community

Title: how to write the formula [Print this page]

Author: Nikolai Strakho    Time: 2024-5-2 21:50
Title: how to write the formula
Edited by Nikolai Strakho at 2024-5-2 22:04

Hello!
I have a table containing invoice lines (invoice_date, product_id, purch_price, quantity)
I have added formula column line_sum = SUM_AGG(${PurchLineSum})/ SUM_AGG(${Количество})
I have added calculation indicator PurchPrice_WA = SUM_AGG(${PurchLineSum})/ SUM_AGG(${Количество})
After that I want to filter top 5 products with the most increase of PurchPrice_WA.

I think, I should make a calculation indicator to compare first and last PurchPrice_WA value in chosen period.
How can I do this?
I have tried this:
IF (${invoice_date}= DEF(MAX_AGG(${invoice_date}), [YEAR(${invoice_date}), MONTH(${invoice_date})]), ${PurchPrice_WA}, 0)
But I've got an error: "IF: Cannot mix aggregated and non-aggregated parameters"







Welcome to FineReport Community (https://community.finereport.com/) Powered by Discuz! X3.2