I'm working with the pentaho data integration, Spoon.
Short description: I want to get the number of times a value has appeared in the flow for each line that reads from the flow.
Long description: I am doing the transformation of the fact table, and when I read the data of a csv file, I have a client has traveled in a certain airplane at a specific time. I want to add a column, available seats, that whenever it appears read a data that a customer travels in a concrete airplane, look in the previous flow what is the number of seats available of that airplane and subtract 1.
Example.
Initially Flight 1 has 160 seats available and Flight 2 has 320 seats available.
CSV
Flight | Client
1 | 1
2 | 2
1 | 3
2 | 4
I can add a column that the value is the total of available seats.
Flight | Customer | Available seats
1 | 1 | 160
2 | 2 | 320
1 | 3 | 160
2 | 4 | 320
but afterwards i do not know how to obtain the minimum value of the seats available given a certain flight in each reading of the flow.
Final output I want in my flow..
Flight | Customer | Available seats
1 | 1 | 159
2 | 2 | 319
1 | 3 | 158
2 | 4 | 318
Many thanks in advance for the time in read my question.