Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted (edited)

Can someone guide me in the right direction. I have here a small sample of date time rate calculation I need help with. I assume to convert the date into hours and the hours into seconds and then calculate the rate. I'm really lost, how should I start approaching this?

Thanks

TMAS

TimeStamp.fp7.zip

Edited by Guest
Posted

Yes of course. Where is the break-point? Do you round up or down at the quarter hour, for example? First thing I would suggest is to use true Timestamps here - it would make it much easier for you and save two fields. But I can give you a specific answer once I know the critieria (the rules) for the rate. :wink2:

Posted

Rules for the rate? Sorry I dont understand.

For the hour I would think round up..? Is it not possible to calculate the Total Amount of Hours Minutes spend or even better have the option (Checkbox) to turn round up, rown down on and off? Hmm. Let me know what info you need and thabks for your help on this!

TMAS

Posted

Example of rules:

Rate is $25 per hour. If the duration was 1 hour 30 minutes, do you charge $25 + $25/2? Or if 15 minutes remaining, 25/4?

Posted

That sounds good, I'm open for any help in this case. Quater hour is fine. Just wonder is it possible to calculate it by the minute, without rounding up or down?

TMAS

Posted

Poop. I deleted my own post. Here it is again...

What I was saying is that you have pieces: EndDate, EndTime, StartDate and StartTime scripted. It is resource-wasteful. If you use Timestamps, it is easier for your Users and timestamps work better for addition/subtraction. Here's the file again. Your dollar result appears in the yellow field.

TimeStamp.zip

Posted (edited)

I see it as this ... your 9 calcs compared to my 3. I hate adding fields if I don't need to. And each evaluation (over the duration of your file) will slow it down. In addition, timestamps can easily be used for summing, Min() and Max() and other things. They are VERY sweet. :wink2:

As you can see, I cheated and used your EndDate etc in my timestamps. But you can SET these fields via script in one whack!!

Edited by Guest
Added 'whack' sentence :^)
Posted

BTW, none of those calcs in my file need to be unstored. I always unstore when I'm working - old (possibly bad) habit. :(

But I always remember to change them before implementing into any solution. :smile2:

Posted (edited)

When I'm changing data in several fields - and if I use globals, related fields or a Get() function, the calculation must be unstored. It isn't needed for any of these calcs because the fields they reference (within the calculation) are within the same record.

But I've been testing calcs (which use related fields etc) which DIDN'T change and I've thought something was incorrect in my syntax. It's cost me time. So I started unstoring all calcs I was testing. I ALWAYS remember to set them properly in a solution (because I also set the index options individually).

Edited by Guest
Added second sentence ...
Posted (edited)

I have one more problem if you dont mind helping me.

I try to get this solution a step further. If you look at the attached file you'll see I try to achieve a additional portal and pause solution. For example the user presses pause to stop the timing, than it should create a entry of the pause in between with description, like in the file. Any clues on this one? Basic Idea. Set Start of Project, pause when needed, description of what done till the pause and after pause resume the job. Does that make sense? Thanks for your help!

TimeStamp_2.fp7.zip

Edited by Guest
Posted (edited)

You changed your file? Well here's the one I worked on. A few comments and roughly what I did.

  • Switched you to timestamp fields which deleted 11 fields.
  • Deleted the timestamps from your main file - we will store all times right within the newly created start/stop records instead, saving 4 fields.
  • Allowed for multi-user mode and multiple Users entering work for one record.
  • Changed the calculation to one Comment suggested - I liked it better.
  • Built in some User protections from entering a new record when they hadn't finished Ending the prior one.
  • Sorted base [color:red]relationship so most current is in top. If there are many entries, the latest entry will be the one a User needs to view.

See how you go with it; I'm not supposed to be playing today. If I missed the ball completely, maybe others can help you, but I truly dislike the idea of using a paused script and I saw no reason that they couldn't click the End just as easily as clicking a Pause. With the visual display of the portal right in front of them (and protections from starting again if they haven't stopped first), I saw no reason for it. I hope it is helpful. :wink2:

[color:green]The file is below. I corrected for rounding and added a display message for the status.

Edited by Guest
Removed file
Posted

Here's a tested example. Each start creates a related record. Each stop requires a reason. And the rounding is as you've requested now. There is no need for a second portal. The Custom Dialog for the reason probably isn't necessary because they can just type the reason in the top portal. I left it in because I was unsure of your process and thought you might want to control it further, ie, refuse to stop without a reason. That can be controlled within the script.

TimeStampREV.zip

Posted (edited)

Wooow this rules, Thats pretty amazing a few calculations making all of this. How about if someone wants to clear the entry, would you say shust a simple delete portal row in this case?

Thank you for your time.

Thomas

Edited by Guest
Delete question
Posted (edited)

Hi Thomas,

Yep, simply deleting a row will change the time totals. Glad it was helpful. :wink2:

UPDATE: Keep in mind that a deletion will not reflect any time used during that StartTimeStamp and EndTimeStamp period but I assume you understand that.

Edited by Guest
Added update

This topic is 6739 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.