![]() |
ShowTheBest.ComInteractive tables on your web pages |
The Case Database Table is the table whose rows or columns are matched, scored, and sorted. Records and fields can be arranged horizontally and vertically. Record names and field names are optional: ShowTheBest.Com will create default names if none are supplied. You can create the Case Database Table with an editor or spreadsheet; it can also be dynamically generated by an external program. (ie, a Perl program that calls a SQL DBMS) -- as long as the program generates a tab-delimited text file (whose name is an input parameter) as output.
Here is an example of a Case Database Table in Excel:
The first line of this file specifies the number of rows and columns in the table. Note that the record labels are provided in column A and the field labels are provided in row 2. The total number of rows in this table (including the record labels) is 24; the total number of columns (including the record labels) is 15.
ShowTheBest requires this table to be saved in tab-delimited text format. This is a file saving option in Excel. An external program that dynamically creates the Case Database Table . also needs to write a file in this format.
Here is an example of the above Case Database Table as viewed in a text editor:
Sometimes you may have to carefully design a Case
Database Table to achieve this. For example, suppose a price
value in the table
is $20-50
. How do we model this?
Here are several alternatives:
Set the value in the Database Table to 20.
Just make sure you make the value a number by removing the $.
If your user types "20" in the value's input widget then there will be
an exact match. If your user types "30" then there will be
a partial match: the intermediate score will be 0.66 for this value (20/30).
You can set the value in the Database Table to 50. Or to 35 (the average).
The choice will affect the match.
Creating a new record that differs only in this value, for example:
Set the value in Record A in the Table Database to 20.
Set the value in Record B in the Table Database to 50.
If your user types "20" then there will be
an exact match for Record A and a partial match (0.4) for Record B.
Set the value in the Case Database Table to $20-50
.
If your user types "$20" in the value's input widget then there will be
an exact match. So will "20". But "25" won't match. (If your user is
told how to use wildcards, then "2*" will match. But "3*" won't.)
Suppose "Cheap" denotes the price range $0-$19; "Moderate" denotes the
price range $20-$60; and "Expensive" denotes the price range $61-$200. Then
we map $20-50
by
setting its value in the Case Database Table to "Moderate."
Set the value in the Case Database Table to $20-50
.
Suppose "Cheap" denotes the formula (data= "$2*") "Moderate"
denotes theformula(data="$3*")+(data= "$4*"); and "Expensive"
denotes the formula(data>"$5*"). Then if this Case Database Table value will return a
match for the "Cheap" formula selection.
This assumes the Database Table value is a number.
If no Display Database is specified in the Controls file, ShowTheBest.Com will display the Table Database. If no header is provided then ShowTheBest.Com will generate a header and link to the eponymous default stylesheet files. (in the styles subdirectory of webpages).
© 2002 Inductive Solutions, Inc. All Rights Reserved.