Jump to content

Calc for Getting a fields name


aapl

This topic is 4865 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 4865 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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