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 3484 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Ok, back when I first started my table the standard calculation of end/start worked fine as a repeating value.

 

now that i want to use this time showing function from another "solution" I can't get it to output correctly.

it will only show the last repetition i entered and won't repeat to the other values.

i know there is a simple solution, but i am at a loss.

Let ( [ $end = GetRepetition ( END ; Get ( ActiveRepetitionNumber ) ) ; $start = GetRepetition ( Start ; Get ( ActiveRepetitionNumber)) ] ;  Round(
Hour( $END -
$Start ) + Minute( $END - $Start) / 60 - BREAKS;2)+
If(
GetAsNumber($END) < GetAsNumber($Start);
24;
0))

Posted

Why are you not posting this followup question to your original post?

Posted

I don't think it's possible to understand your question. Instead of posting a calculation that doesn't do what you want, you should start with what you have (which fields will the calculation use as its input, what are their types, and what do they represent) and then explain what do you want to actually calculate.

If I dare to venture a guess: supposing you have two repeating Time fields named Start and End, then a calculation field, with its result type set to Time, and the number of repetitions to (at least) the same number of repetitions as the two input fields =

End - Start

will return - in each repetition - the duration calculated using the start and end times in the corresponding repetitions of the input fields.

it would be probably better to use individual records in a related table instead of the repeating fields.

Posted

Let ( [ $end = GetRepetition ( END ; Get ( ActiveRepetitionNumber ) ) ; $start = GetRepetition ( Start ; Get ( ActiveRepetitionNumber)) ] ;  Round(
Hour( $END -
$Start ) + Minute( $END - $Start) / 60 - BREAKS;2)+
If(
GetAsNumber($END) < GetAsNumber($Start);
24;
0))

This calculation is very hard to read. May I suggest for future posts that you add a bit of formatting to your calculations? E.g.

Let ( [
  $end = GetRepetition ( END ; Get ( ActiveRepetitionNumber ) ) ;
  $start = GetRepetition ( Start ; Get ( ActiveRepetitionNumber ) )
  ] ; 
  Round ( Hour ( $END - $Start ) + Minute ( $END - $Start ) / 60 - BREAKS ; 2 )
  +
  If ( GetAsNumber($END) < GetAsNumber($Start) ; 24 )
)

Now at least it is is (better) readable, and problematic areas can be spotted more easily.

PS: You shouldn't declare $vars in Let(), unless you know what you're doing.

Posted

When it was just the straight Time /end calculations, the fields worked. When i try to use the rounding formula all hell broke loose. if i changed the /let code to a function, would it go back to operating the way i wanted?

( i had it originally as if end < start; 24+End-start;end-start (With hour (start) (hour(end) being used. It worked as I intended.  - but then it wouldn't show the partial times.

As for the variables I didn't want to create another cell to do the calculations i needed.

 

 

Posted (edited)

if i changed the /let code to a function, would it go back to operating the way i wanted?

Who knows? (Actually, the question makes no sense whatsoever. Let() is already a function.) 

you should start with what you have (which fields will the calculation use as its input, what are their types, and what do they represent) and then explain what do you want to actually calculate.

 

Edited by comment

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