Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Search Result problem

Featured Replies

  • Newbies

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.

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

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).

  • Author
  • Newbies

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.

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 smile.gif

All the best.

Garry

  • Author
  • Newbies

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.

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

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

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.