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.

Layouts: If ...then? Choosing to show all or some?

Featured Replies

Hello,

I've been quite a bit of time working on Filemaker for about a year so I'm not a complete newbie though, I have no idea how to post this question or what the feature is called:

I have multiple fields which show Credits that were applied in a DB such as:

1. Pro-rated

2. Family Discount

3. Scholarship

When working on statements layout, I need to itemize where the credits came from. Rather than placing straight text with the above 3 fields, I rather only display the field if the field is not empty. In other words, how do I generate calculation to show only fields that are NOT empty? Do I need to build a long "IF...then ..if, then" formula? I tried CASE but that doesn't work because if there is data on the field 1 and field 3, it only shows field 1 since it is the first match.

Let me know what you suggest or if I need to post this elsewhere. I will be happy to provide more details if needed. I just want to avoid bombarding anyone.

Thanks in advance!

Shelley

Version: v6.x

Platform: Windows 2000

> how do I generate calculation to show only fields that are NOT empty?

The IsEmpty() function tells if a field is empty or not.

In cases like this I make a single calculation that concatenates the various fields & necessary punctuation.

Example for two text fields separated by a comma when both are present. For total explanation "Left.Text &" could be replaced by:

If( IsEmpty(Left.Text),

"",

Left.Text

) &

The example:

Left.Text &

If( IsEmpty(Left.Text) or IsEmpty(Right.Text),

"",

", "

) & Right.Text

Did I answer the right question?

  • Author

Hmm, I see where you are going with this. Pardon me but I'm not exactly sure how I would implement this. Here is what I would like to see as a result - here are is a scenario:

Example 1:

A Field labelled: Prorate = 100

A Field labelled: Discount = (null)

A Field labelled: Famiy = 200

The calculation field in the layout would then show:

"Prorated Discount = $100

Family Discount = $200"

So it would need to know that Prorated is not empty, thus provide:

"Prorated Discount = $" & Prorated

also Family is not emtpy, thus provide:

"Family Discount = $" & "family.

If I concatenated the fields as you suggested, I would get:

"100, , 200" (or would I get "100,,200"???) from the above example.

I have 6 different discounts so would it make sense to generate a CASE formula with 6 different possiblities? I can see how I can use the LEFT, RIGHT ...how can I use that when I am using 6 concatenated formulas since I won't know how many characters to move in the middle?

Thanks again for your help!

Shelley

Shelley->

Not quite sure I've got it, but here's what I think you're asking:

If( not IsEmpty(Prorated),

"Prorated Discount = $" & Prorated,

""

) &

If( not IsEmpty(Family),

If( not IsEmpty(Prorated),

"PM",

""

) &

Family Discount = $" & "family,

""

)

The "PM": substitute the paragraph mark (3rd down on left of the 8 symbol buttons in the calcuation window) for the PM. The paragraph mark will be in quotes. This gives you a new line after it.

Are the discounts mutually exclusive (only one at a time) or can they occur in any pattern?

Sam

  • Author

Thanks for responding. I didn't realize I could do "If ...then" & " If ...then" commands meaning thread multiple "if...then" formulas together. That makes sense now.

As for the discounts, they are in random pattern if that is what you mean? In other words, some folks get 3 discounts, some get none and some get only 1 discount. Does that help?

Thanks again,

Shelley

Shelley->

My method will work if you have various patterns of discounts.

The If..Then function can usually be placed in a calculation where any value will go. A number example with two If...Thens:

23 + If( A>40, 17, 34) + (12 * If( C=239, 2, 1))

Sam

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.