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.

How to find biggest values below 6000 and above 6000 from all fields?

Featured Replies

Hi!

 

I have a database with 7 columns and several rows containing numbers (see the picture). I would need to find the biggest numbers in whole found set below 6000 (1000 - 5999) and above 6000 (>6000). For example 1017 and 6037. I've tried different approaches but now I have to give up. Probably the solution is vey simple but I just cannot figure it out now.☹️ Any ideas?

866808070_Screenshot2019-12-2915_43_46.thumb.jpg.00aa4bc10522ee3dce699c3921181ba6.jpg

Edited by R2D2

Consider changing your structure to a relational one: instead of 7 columns (which appear to be sparsely populated) use 7 (or any other number of) records in a child table. This will allow you to deal with just one set of numbers instead of 7 - and is likely to make a lot of other tasks easier too.

To find the largest number, you could perform a find for values in the given range, then sort the records and get the value from the last (or the first) record. Or use a summary field defined as Maximum of the value field. 

Achieving the same thing with your current structure would be very cumbersome. 

 

  • Author

Thank you comment! I need to keep this one table "non-relational" because it is kind of a "base table" to a numerous other relational tables. Of course this could be done as you said, but then I'll be completely lost among all the relations😫

I found a clumsy but working solution: I created 7 Summary Fields (one for each column) with Maximum of found set. Then I made a script with 14 repetitive Finds with search criterias <6000 and above 6000, and picked after each Find the maximum number to a variable. Finally I listed those variables and picked the winners.

As I said, dirty code, but it works

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.