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.

Stop field calculation

Featured Replies

I currently have 3 fields relating to an employees employment date:

The first field is the date of hire

The second field is a calculation of years from the first field.

The third field shows an employees exit date.

My question is this: is it possible to have the second field (calculation of years worked) stop calculating the years if a date is entered into the third field (date of exit)

I know I could get a calculation from field one and three after the employee leaves however I do not want a calculation of that nature, I need to be able to look at the field and get a “live” display of the worked years.

Or does anyone know of a better way showing these three fields of data.

Thanks,

James

Edited by Guest

Wrap your calculation as follows:

Case ( not ExitDate ;

yourcalchere

)

UPDATE: I'm unsure what you mean by 'live display.' The above will blank the field if the Employee terminates. If instead, you want the years to quit calculating and 'freeze' when terminated, we'd need to see your age calc. Although you phrased your post quite nicely, I'm still unclear on the result required.

Edited by Guest
Added Update

  • Author

LaRetta,

Thanks,

I did as instructed, I assumed it workded???

when the date of exit was entered the second field showing the years worked then showed empty.

Is there a way to keep the last number in the second field visible?

Thanks again,

James

  • Author

I jsut saw your update...here is the calc including your wrap. this is the first field (Date_Of_Hire) and shows in the second field (Years_of_Service)

You are correct...I do wish for the second field to remain visible, and to stop calculating.

Case ( not Date_Of Exit ; Year(Get(CurrentDate)) - Year(Date_Of_Hire) -If(GetAsNumber(Get(CurrentDate)) < GetAsNumber(Date(Month(Date_Of_Hire); Day(Date_Of_Hire); Year(Get(CurrentDate)))); 1; 0))

Edited by Guest

I had posted then deleted it. I discovered an inconsistency when using a variable with a blank date. Anyway, that's another issue. Calculation should be number and unstored (in Storage Options):)

Let (

endDate = Case ( ExitDate ; ExitDate ; Get ( CurrentDate ) ) ;

Year ( endDate ) - Year ( Date_Of_Hire ) - ( endDate < Date ( Month ( Date_Of_Hire ) ; Day ( Date_Of_Hire ) ; Year ( endDate ) )

)

)

  • Author

LaRetta,

I tried your calc: and it gave me a number resulting from the Date of Hire and the Date of Exit.

What I am attempting to do is:

THE EMPLOYEE IS STILL WORKING:

A calculation showing in the second field (Years_Of_Servcice) so that a user can bring up that employee and see at a glance that they have been there x-number of years…this is what I am calling a “Live” number…it is still calculating because the employee is still working. so you are seeing fields showing: Hire Date / Years Worked / (Exit Date is empty)

THE EMPLOYEE LEAVES:

Now, when the employee leaves, the (Date_Of_Exit) field is entered, when this date is entered…it stops the calculation and still shows a number in the second field (Years_Of_Service) which remains visible….however all calculation have ceased…so you are seeing fields showing: Hire Date / Years Worked / Exit Date.

This is so the user can bring up the employee at any point during active employment or after an employee exits and show that they worked x-number of years.

I’m thinking I may have to generate another field?

Give me a minute and Ill post a pic of the fields.

Thanks for your help.

James

Edited by Guest

If no ExitDate is entered, it will continually provide the years of service for the active Employee. If terminated and ExitDate is given a date, it will stop at the ExitDate. Like so?

hire.zip

  • Author

Im not sure how to post here so here is the link to the layout.

The green bar is what Im working on.

http://www.bartowtech.com/homey/image1.jpg

I don't know what to tell you. Why does the Employee have a Date_Of_Exit when they are still Active? It should be blank. If you wish to display the current date in place of Date_Of_Exit, if the Employee isn't terminated, you can do so; but it can't be an auto-enter (replace) because it won't refresh.

Simply, seeing a Date_Of_Exit date on an Active employee makes no sense to me. Did you make sure the calculation is UNSTORED?

  • Author

Sorry about that screenshot...your are correct it is blank, I was working on the layout when I took the shot.

The correct shot would show the status field reflecting that the employee was gone for whatever reason. When the status field shows anything but active they are sorted not to show (only active employees, who would only be showing a hire date and years of service at that point would be shown)

I have put in place your last calc, everything seems to be working as needed with that one.

Thank you so much for the help, I dont think I could have figured that one out on my own...hope I can return the favor one day.

James

Edited by Guest

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.