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.

Featured Replies

  • Newbies

I am using the following equation to change background colors:

Case (Inc Hrs < 150;GetRepetition ( gColors; 1);

Inc Hrs >151;GetRepetition ( gColors; 2);

Inc Hrs >301;GetRepetition ( gColors; 3))

1=green,2=yellow,3=red

I've run various figures in the fields to change the value that is used to calculate which repetition to get, seems to work find until it hits a value of 1000 and above, color changes to yellow. Any suggestions.

Case() stops at the first true value, you need to reorganize your tests like this:

Case (Inc Hrs < 150;GetRepetition ( gColors; 1);

Inc Hrs >301;GetRepetition ( gColors; 3);

Inc Hrs >151;GetRepetition ( gColors; 2))

because if its greater than 301, it will definitely be greater than 151 also.

Another possibility to consider, if you like "small" like I do, and hate typing half as much as me:

GetRepetition( gColors; Case( Inc Hrs < 150; 1; Inc Hrs > 301; 3; Inc Hrs > 151; 2 ))

What if Inc Hrs is 302? The 2nd repetition of gColors is retrieved and the Case terminates because Inc Hrs > 151. You'll never reach the third test in the Case. Try working backwards. Case( Length(Inc Hrs); Case( Inc Hrs > 301; GetRepetition( gColors; 3 ); Inc Hrs > 151; GetRepetition( gColors; 2 ); gColors ) ).

The Length simply ensures that Inc Hrs isn't empty before a value is returned. The final option is gColors because GetRepetition( gColors; 1 ) is redundant. The first repetition of a field is always returned, unless you specify an alternate one or a different repetition is being set.

I just noticed that from 150 - 151 you've not requested a result, because 150 is neither less than 150 or greater than 151. Is this really what you want?

If you want to get tricky and remove the Case altogether,

GetRepetition( gColors; (Inc Hrs < 150) + 2 * (Inc Hrs > 151) + (Inc Hrs > 301) )

  • Author
  • Newbies

Your solution worked great, in fact both worked and you are right I do like to keep the expression short. It never crossed my mind to swap positions of the last two repetitions. Thanks for the help.

  • Author
  • Newbies

Looks like there are various flavors of this solution. Thanks for another solution.

  • Author
  • Newbies

I started out using the less than/equal sign but kept getting an error message, elected the other route. The 1 represents one page for an hour estimation not really critical but I'll see with this new method if I can get it fixed and working correctly.

Note that you will need to specify the table name for each field. Maybe this is why you were getting an error?

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.