Newbies Extell Posted November 24, 2002 Newbies Posted November 24, 2002 Ok...here is my situation: Database: Field 1 (10 options): 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 Field 2 (10 options): A, B, C, D, E, F, G, H, I, J What I need to do is find how many records have both 3, and D as field entries. And I need to output to a webpage. I dont know if I'm just having major brain blockage here but I cant think of how to do this.
Garry Claridge Posted November 24, 2002 Posted November 24, 2002 You can select each field as usual; e.g.: [FMP-ValueList: Field1, List=Options1] <input type="radio" name="Field1" value="[FMP-ValueListItem]" [FMP-ValueListChecked]>[FMP-ValueListItem] [/FMP-ValueList] [FMP-ValueList: Field2, List=Options2] <input type="radio" name="Field2" value="[FMP-ValueListItem]" [FMP-ValueListChecked]>[FMP-ValueListItem] [/FMP-ValueList] <input type="submit" name="-find" value="Search"> Then in your format file you would use:This many records have both: [FMP-CurrentFoundCount] Hope this helps. Garry
Vaughan Posted November 25, 2002 Posted November 25, 2002 You could also create a calc field in the db which concatenates the two fields. Use this field to generate a value list and as the search field. The value list might get a bit long, but at least users will only see values that are in the database (ie, they cannot search for invalid combinations).
Newbies Extell Posted November 25, 2002 Author Newbies Posted November 25, 2002 Ok...only problem is: On one web page I need to find out how many 1C's there are how many 8A's, and how many 5D's there are. How would I make the link to the page and how do I poll this kinda comparisons all on one page? Example output: 1:A: 4 1:B: 0 1:C: 8 2:G: 2 2:D: 1 etc.
Garry Claridge Posted November 26, 2002 Posted November 26, 2002 First, as Vaughan indicated, concatenate the fields with a calc field. Then have another database with the 100 combinations as the key field data for each record. Relate the main file/table to the new file/table with the calc field. Create a portal, in the new file, and a count field. You can now sort and list the various combinations with counts. This one method which springs to mind after a big lunch in Sydney All the best. Garry
Newbies Extell Posted November 26, 2002 Author Newbies Posted November 26, 2002 Geeze! There has to be an easier way to do this. Just to let you know, this is going to be a marketplace kinda like E-Bay but no real money involved. Its a MarketPlace for a MMORPG.
Garry Claridge Posted November 26, 2002 Posted November 26, 2002 You can, at least, start my creating the concatenated field ( Field1 & Field2). From here you can look at various methods. I will have more time on the weekend to do a couple of tests. All the best. Garry
Garry Claridge Posted December 1, 2002 Posted December 1, 2002 Here is a solution: 1. Create a Calculated field called "fieldcombo": (Field1 & Field2) 2. Create a Relationship "combos" on the same file using the "fieldcombo" field. (Self Join) 3. Create a Calculated field called "count": with value (1) 4. Create a Calculated field called "count_combos": Count(combos::count) 3. Create a Layout "combo_list"; include fields "fieldcombo" and "count_combos" Use this Javascript: <body><script> i = 1 ; [FMP-Record] [FMP-If:count_combos.gt.] x = [FMP-Field:count_combos] ; if (i == x) { document.write("[FMP-Field:fieldcombo] [FMP-Field:count_combos]<br>") ; i = 1 ; } else {i++ ;} ; [/FMP-If] [/FMP-Record] </script> </body> And use the URL (or equivalent Form): http://localhost:1154/FMPro?-db=combotest.fp5&-lay=combos_list&-format=combo_list.html&-sortfield=count_combos&-sortorder=Descend&-sortfield=fieldcombo&-findall Hope this helps. Garry
Recommended Posts
This topic is 8098 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now