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

conditional statements as calculations

Featured Replies

I have a one to many relationship where I need to calculate the value of a field in the parent based upon the value of a field in the children.

It's basically just a true of false value.

The parent is set to true by default.

If all the children have a false value, then

the parent is false.

My apologies if the explanation is poor.

I've attached a sample which makes things clear.

I appreciate any pointers.

conditions.fp7.zip

Theory is ... count the Tasks::TaskStatus. This will only count the field if it contains a value (done). I am assuming that Done or blank are the only possible values (by looking at your value list). And then count the number of child records. If the count is the same, all child records are done or boolean 1, otherwise JobStatus should be false or 0. So your Job Status should be a calculation (number). It will automatically be unstored. And the calculation would be:

Count ( tasks::kf_jobs ) = Count ( tasks::task_status )

When you wish to display this Job Status, select Format > Number and set it to boolean with only a value in the yes side. If the results need to be longer than 7 characters, you can use conditional formatting (place the words on the layout) and conditional format to turn the text same color as background if boolean 0 (false).

Edited by Guest
Added explanation about displaying words instead of 1 in Job Status

  • Author

Thank you for the pointer. That worked like a charm. The theory part seems so obvious and I should be thinking that way. But I'm learning.

This is what worked for me in the job status calc field. I don't know if this is the most efficient way, but it worked.

if (Count ( tasks::kf_jobs ) = Count ( tasks::task_status ); int ( 1 ) )

Edited by Guest

Your formula is essentially the same as LaRetta's, but FYI, the first part "count(this) = count(that)" will evaluate to "1" if it's true. That's her formula -- and that's all you need. Your formula essentially says "If 1, then 1," which doesn't add any improvement, unless you work for the dept. of redundancy dept. :(

unless you work for the dept. of redundancy dept. :(

or any bureaucratic government office. :

  • Author

Lol! :( Thanks, I didn't realize that was automatic.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.