Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everybody,
I have the following problem:
I would like to calculate the sales (sales volume * price). The price should come from a historical article table, however, and I need the price at which the day is the minimum.
This is linked to the question whether one would have earned more or less if the prices had remained as it were at the beginning. I have created the following expression.
KBETR = Price
ABSMG = amount
SUM(AGGR(SUM(ABSMG) * SUM({<TAG_ID={"$(=MIN(TAG_ID))"}>}KBETR/1.19),MATNR))
In an article that works wonderfully. If, however, I select several articles, the AGGR function takes the minimum tag of all articles. It can be, however, that with certain articles on this day no price is registered. The minimum day should be calculated for each item.
could someone help me here?
May be this
Sum(Aggr(Sum(ABSMG) * Sum(Aggr(If(TAG_ID = Max(TOTAL <MATNR> TAG_ID), KBETR/1.19), MATNR, TAG_ID)), MATNR))
Thank you very much. It seems to be correct.