Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I got the following data set:
NAME | VERSION |
---|---|
AAA | 1 |
BBB | 2 |
BBB | 3 |
and use set analysis to a get maximum version of the records grouped by NAME with a current selection in account
Max({$<VERSION={'=Aggr(Max(VERSION), NAME)'}>} VERSION)
I expect the following:
NAME | - |
---|---|
AAA | 1 |
BBB | 3 |
but have
NAME | - |
---|---|
AAA | 1 |
BBB | 2 |
so it seems that inner aggregation doesn't work as I expect and instead returs the first value from the group (changin' the enclosed function to Min, Sum or whatever doesn't change the result).
Anybody see a wick point in the approach?
Thanks and regards,
Dmitry
hi,
if you use this:
Max({$<VERSION={'=Aggr(NODISTINCT Max(VERSION), NAME)'}>} VERSION)
it works.
C u,
Stefano
hi,
if you use this:
Max({$<VERSION={'=Aggr(NODISTINCT Max(VERSION), NAME)'}>} VERSION)
it works.
C u,
Stefano
Thanks a lot, it works!
But I have to extend my question:
If we have a third column QTY and try to calculate the sum using
=Sum({$<VERSION={'=Aggr(NODISTINCT Max(VERSION), NAME)'}>} QTY)
it will return the whole sum by AAA and BBB (e.g 10 of AAA + 20 of BBB VERSION 2 + 30 of BBB VERSION 3 = 60) and not the 40 (10 of AAA + 30 of BBB VERSION 3) as it would be expected. Thats the point I completely messed with.
Thanks and regards,
Dmitry
hI,
look at this example.
C u,
Stefano.
Thank you very much! This exactly what I've been looking for and this approach works perfectly! Excelent.