Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
i have a problem with the following set analysis Expression:
Basis table:
part | valid from | price |
(a32tnr) | (f105_Preise.Datum) | (f105_Preise.finPreis) |
1 | 13.08.2017 | 3,57 |
1 | 04.02.2018 | 3,78 |
1 | 15.08.2018 | 3,78 |
1 | 30.11.2018 | 8,47 |
2 | 19.08.2018 | 145,07 |
2 | 26.08.2018 | 99,89 |
2 | 09.11.2018 | 149,15 |
2 | 31.01.2019 | 144,91 |
I need the price per part with max date. Therefore i use the Expression:
sum({<f105_Preise.Datum = {"$(=Max(f105_Preise.Datum)-1)"}>} f105_Preise.finPreis)
The result is:
part 2 = 144,91€ (correct!)
part 1 = 0€ (incorrect, 8,47€ should be the correct result)
The Problem is that the max(date) is 31.01.19 and there is no price for part 1 with this date.
Could please someone help me to correct the expression. How to find the max(date) price per part?
Thank you!
Kind regards, Sven
Try using this instead of set analysis
FirstSortedValue(
Aggr(Sum(f105_Preise.finPreis), a32tnr, f105_Preise.Datum),
-Aggr(f105_Preise.Datum, a32tnr, f105_Preise.Datum)
)
Buenas, yo pensaría en usar un AGGR y una expresión MAX, para generar una tabla con el numero de pieza y su precio según la fecha máxima.
Primero el número de pieza o Item, lo agrego como dimensión, luego agrego una expresión AGGR para obtener la fecha máxima, después con un ONLY o MAX traigo el precio.
Saludos!!!!