Re: [htmltmpl] Nested loop puzzle - variable columns and rows
Brought to you by:
samtregar
From: Puneet K. <pk...@ei...> - 2004-02-11 13:56:50
|
On Feb 11, 2004, at 7:08 AM, LDT wrote: > I'm a little stumped on how best to approach a particular problem.=A0 = I=20 > have a report I'm building that will span an uncertain number of=20 > columns and uncertain number of rows.=A0 Below is a sample of what the=20= > report might look like: > > > Account=A0=A0 Descr=A0=A0 Jan=A0=A0 Feb=A0=A0 Jun=A0=A0 Aug=A0=A0 = Nov=A0=A0=A0=A0 Total > 51112=A0=A0=A0=A0 Fred=A0=A0=A0=A0 $5=A0=A0 $10=A0=A0=A0 $0=A0=A0 = $15=A0=A0=A0 $0=A0=A0=A0=A0=A0=A0 $30 > 51119=A0=A0=A0=A0 Lucy=A0=A0=A0=A0 $0=A0=A0=A0 $0=A0=A0=A0 $7=A0=A0=A0 = $0=A0=A0=A0 $0=A0=A0=A0=A0=A0=A0=A0 $7 > 51121=A0=A0=A0=A0 Ethel=A0=A0=A0 $0=A0=A0 $20=A0=A0=A0 $0=A0=A0=A0 = $0=A0=A0=A0 $3=A0=A0=A0=A0=A0=A0 $23 > 51178=A0=A0=A0=A0 Ricky=A0=A0=A0 $1=A0=A0=A0 $6=A0=A0=A0 $3=A0=A0=A0 = $2=A0=A0=A0 $4=A0=A0=A0=A0=A0=A0 $16 > > The data I pull from the database comes into a result set that looks=20= > like this: > > Account=A0=A0 Month=A0=A0=A0=A0 Amount > 51112=A0=A0=A0=A0=A0=A0=A0 1=A0=A0=A0=A0=A0=A0=A0=A0=A0 5 > 51112=A0=A0=A0=A0=A0=A0=A0 2=A0=A0=A0=A0=A0=A0=A0=A0 10 > 51112=A0=A0=A0=A0=A0=A0=A0 7=A0=A0=A0=A0=A0=A0=A0=A0 15 > 51119=A0=A0=A0=A0=A0=A0=A0 6=A0=A0=A0=A0=A0=A0=A0=A0=A0 7 > 51121=A0=A0=A0=A0=A0=A0=A0 2=A0=A0=A0=A0=A0=A0=A0=A0 20 > 51121=A0=A0=A0=A0=A0=A0 11=A0=A0=A0=A0=A0 =A0=A0=A0=A03 > .. Look at the following thread=20 http://www.perlmonks.org/index.pl?node_id=3D324008 I have a complete, working code snippet there for normalizing a=20 denormalized recordset. You can use that as the base to build your own=20= data transformation routine. |