Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: dhrobertsonI have a problem whereby I need to be able to allocate some names to the field 'Team', based on the 4 columns at the end.
there was a percentage split calculated in order to establish that, for example, out of 4 rows that state Addenbrookes, 1 record needs the Team to say Der, 2 of the rows for Addenbrookes need to say RA and 1 record needs to say SPA. it does not matter which rows are assigned to which teams, just that the split is correct.
the same goes for the others rows....
so 5 rows for birmingham need to have the team specified as Gas and the last 3 need, the team needs to be changed from Unspecified, to RA.
Team:string, Register:string, Der:int, Gas:int, RA:int, SPA:int
Unspecified, Aberdeen, 0, 0, 0, 1
Unspecified, Addenbrookes, 0, 1, 2, 1
Unspecified, Addenbrookes, 0, 1, 2, 1
Unspecified, Addenbrookes, 0, 1, 2, 1
Unspecified, Addenbrookes, 0, 1, 2, 1
Unspecified, Liverpool, 0, 0, 2, 0
Unspecified, Liverpool, 0, 0, 2, 0
Unspecified, Amersham, 0, 0, 0, 1
Unspecified, Antrim, 0, 0, 1, 0
Unspecified, Barnsley, 0, 0, 0, 1
Unspecified, Birmingham, 0, 5, 3, 0
Unspecified, Birmingham, 0, 5, 3, 0
Unspecified, Birmingham, 0, 5, 3, 0
Unspecified, Birmingham, 0, 5, 3, 0
Unspecified, Birmingham, 0, 5, 3, 0
Unspecified, Birmingham, 0, 5, 3, 0
Unspecified, Birmingham, 0, 5, 3, 0
Unspecified, Birmingham, 0, 5, 3, 0
clearly some sort of aggregation needs to happen based around the register field. in my mind some sort of iterative process for each of the Register groupings, which decrements each of the last 4 columns in turn, at the same time changing the Team from Unspecified for the relevant team name.
I have looked at various LavaStorm scripts available, dealing with holding variables across rows, but I'm at a loss as to how to work it out. It could be that I'm trying to make it too complicated and there is a very simple way to do this, but I'm too new at this to know what to do....
any help would be much appreciated...
regards
Doug