Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guyz,
Here is m problem :
AS you see, I have for a year an amount. I would like to show only the last year for un ID.
In this case, i would like to show 2010 -> 0,00.
Witch function i have to use ? (rank ? maxstring ?)
Thx in advise
When you sum Amount:
Sum({$ <Year={'$(=Max(Year))'}>} Amount)
let me know
Hi Alessandro,
I think you miss understand me. I don't want to see the amount of the last year.
I always want to see, on my tab the 4 column for the Max(Year) of the line.
Example :
I want something like this :
ID - NB PERSON - AMOUNT - YEAR
01010001 - 2 - 0,00 - 2010 (because it's the last year for this ID)
01010002 - 1 - 22 412,00 - 2013 (because it's the last year for this ID)
etc ...
Maybe I have to modify something in my load ?
You can try and flag the MaxYear for each ID in the script and then use that in your set analysis statement.
Best,
S
I'have find a solution with SQL :
1 - I do a rqs for ID and MAX(Year)
2 - I do a rqs for ID, NB PERSON, AMOUNT, MAX(YEAR)
3 - I join the 2 table with ID=ID and MAX(YEAR)=MAX(YEAR)
So I have all the data for the max(year) in 1 line
Join(yourTable)
LOAD ID,
MAX(Year) as Year,
1 as MaxYearFlag
Resident yourTable
Group By ID;
This will add another column to your table where ID and its corresponding Max(Year) match.
Hope this will help.
Best,
S