Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ssmhg2712
Contributor II
Contributor II

set analysis - max date per article

Hello,

i have a problem with the following set analysis Expression:

Basis table:

partvalid fromprice
(a32tnr)(f105_Preise.Datum)(f105_Preise.finPreis)
113.08.20173,57
104.02.20183,78
115.08.20183,78
130.11.20188,47
219.08.2018145,07
226.08.201899,89
209.11.2018149,15
231.01.2019144,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

 

3 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Create a table chart and include a32tnr as dimension. Create an expression like this:

FirstSortedValue(f105_Preise.finPreis,-f105_Preise.Datum)
sunny_talwar

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)
)
Marcos_rv
Creator II
Creator II

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.

 

AGGR MAX.PNG

Saludos!!!!