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.

Multiple Calculations in one?

Featured Replies

Is it possible to have multiple (as in not related) calculations in one field?

For example. I have a field that displays a number based on a calculation. I also need the text of that field to change color to white if another field has white text.

What would be the best way to combine these two calculations into one?

Hello Heathbo,

What you're describing is certainly possible.

It is probably best done by 'nesting' the calculations - ie placing one calculation inside another which applies the teext color. Eg:

TextColor(

YourFirstCalcBaseOnFieldOneHere

; PatternCount(GetAsCSS(FieldTwo); "color: #FFFFFF;") * 16777215)

- which will make the result of the first calc white if there is any white text in FieldTwo, but otherwise it will be black. :)

  • Author

I tried what you said but it won't change the color of the text. Here is what I have. Maybe you can find what's wrong with it.

TextColor(

Case ( Att15 > 0 ; Att15 + PAtt Container)

; PatternCount(GetAsCSS(Att15); "color: #FFFFFF;"))

Well, Heathbo,

You *say* you tried what I suggested - but there are several respects in which the calc expression you are using does not resemble the syntax in my previous post.

For one thing, your field references within the Case( ) argument and within the GetAsCSS( ) function point to the same field ("Att15"), whereas your earlier explanation stated that you wished to base the calc result on one field but determine its color based on another.

For another thing it looks as though you may be trying to add a container field to a number field (or, if "PAtt Container" is not a container field, you are using rather misleading field names).

And last, but not least, you have omitted the final clause of the formula I recommended - the " * 16777215" bit - and it ain't going to work without that (that is the color number for white). :)

  • Author

Sorry to be misleading.

This is what I meant.

I have 3 fields.

The one this calculation is in titled "Result".

A field titled "PAtt Container" This is just a field that contains a

number brought in by a drop down menu.

A field titled "Att15" In some records this has a number and

in some it doesn't. Thats why I was trying to link it to the

Case ( Att15 > 0 ; Att15 + PAtt Container). Basically, if Att15

has a number, make this field (Result) that number + PAtt Container.

Finally the text color calculation. Basically, if the text in Att15 is white, make the text in Result white.

I hope this clears it up.

Thanks for the help.

Fine, Heathbo,

So use the syntax format that I suggested earlier and let us know how you go. :)

  • Author

It works perfectly!! Thank you soo much.

I originally thought the "* 16777215" was multiply the result by 16777215. Obviously it doesn't do that. What does the star and number mean?

Hi Heathbo,

The "* 16777215" multiplies the result of the PatternCount( ) function to 'scale' it to the integer value of white in the RGB color system.

Ie when the PatternCount( ) function returns zero, you have 0 * 16777215 which is equal to zero, which is the color value of black, but when the PatternCount( ) function returns 1, you have 1 * 16777215, which is equal to 16,777,215 which supplies the color value of white to the TextColor( ) function. :)

  • Author

Brilliant.

Thanks

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.