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.

Calc for Getting a fields name

Featured Replies

Hi guys I have a problem which I am sure is easy to solve when you know how!

I have three Date Fields named: LastAppointment, RebookedSince, and Cancelled

My calculation field needs to display the name of the field with the greatest date in.

So for example if (dates displayed DD/MM/YYYY):

LastAppointment = 01/01/2011

RebookedSince = 02/01/2011

Cancelled = 03/01/2010

My calculation field would need to display "Cancelled" as that is the field with the greatest date. It also needs to ignore any empty fields

Hopefully someone can head me in the right direction here,

Many thanks!

Let( [

m = Max ( LastAppointment ; RebookedSince ; Cancelled ) ;

result = Case ( LastAppointment = m ; "Last" ; RebookedSince = m ; "Rebooked" ; Cancelled = m ; "Cancelled" ) ] ;

result )

  • Author

Let( [

m = Max ( LastAppointment ; RebookedSince ; Cancelled ) ;

result = Case ( LastAppointment = m ; "Last" ; RebookedSince = m ; "Rebooked" ; Cancelled = m ; "Cancelled" ) ] ;

result )

Thank you! This works perfectly.

If you have time would you mind explaining to me what it actually means in non calculation terms?

Many thanks.

Find the highest value of the three fields.

Compare that value to each of the three fields.

When there's a match, return the specified text.

Let() permits you to define variables in the calculation.

Max() checks a set and pulls the highest value.

Case() tests and returns results.

My calculation field needs to display the name of the field with the greatest date in.

What if there is a tie?

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.