[Zope-DB] Creating a "matrix" HTML table from a database table

Robin Smidsrød robin@mobilife.com
Mon, 10 Mar 2003 09:36:34 +0100


I went for this solution, but instead of using inner join, I used
subselects (which is quite easy in Interbase).

Thanks for giving me the tips!

-- Robin

> -----Original Message-----
> From: zope-db-admin@zope.org [mailto:zope-db-admin@zope.org]=20
> On Behalf Of Norman Khine
> Sent: 7. mars 2003 11:07
> To: Robin Smidsr=F8d
> Cc: zope-db@zope.org
> Subject: RE: [Zope-DB] Creating a "matrix" HTML table from a=20
> database table
>=20
>=20
> surely, the y-axis should be a numeric value, such as the total ie
> product_count accumulated vs each day and the graph will be=20
> for that actual
> product.
>=20
> you'll probably need a 3-d graph, where x-axis is the date,=20
> y-axis will be
> the accumulated count, and z-axis the product_id!
>=20
> then you should be able to pull your data using inner join=20
> statement and get
> the required report as
>=20
> product      | day1  | day2  | day-nth
> -------------------------------
> product_name | total | total | total
>=20
>=20
> and so on...
>=20
>=20
>=20
> -----Original Message-----
> From: zope-db-admin@zope.org=20
> [mailto:zope-db-admin@zope.org]On Behalf Of
> Robin Smidsr=F8d
>=20
> Sent: 07 March 2003 08:05
> To: zope-db@zope.org
> Subject: [Zope-DB] Creating a "matrix" HTML table from a=20
> database table
>=20
>=20
>=20
> I need to make a report from data contained in a database.
> The X axis is one specific SQL call, and the Y axis is one=20
> specific SQL
> call.
> For each cell I need to take data from the X and Y SQL call and do
> another SQL call.
>=20
> How can I speed up this, so that I I don't need to call ~80 SQL
> statements to display the page?
>=20
> The X-axis is the date, the Y-axis is the product, and the=20
> cell-content
> is the product count for the specific date.
>=20
> Get the point?
>=20
> This data is of course contained in one simple table with=20
> day,product_id
> and product_count accumulated.
>=20
> Should be very simple, but I'm fairly fresh to Zope (and Python).
>=20
>=20
> Mvh,
> Robin Smidsr=F8d
> Teknisk sjef
>=20
> --
> MobiLife AS   | Tlf:  +47 33334141 | Dir.:  +47 33334143
> Kilengaten 1  | Fax:  +47 33334140 | Mobil: +47 91593393
> 3117 T=F8nsberg | post@mobilife.com  | robin@mobilife.com
>=20
>=20
>=20
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://mail.zope.org/mailman/listinfo/zope-db
>=20
>=20
>=20