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

Recommended Posts

Posted

I have a database for a private music teacher and we're trying to have it automatically keep track of lesson charges based on the number of students in each family, the length of the lessons, and the charge per lesson at a rate per half hour. I've been using simple calculations that work fine if each lesson is the same length. Now we're having to deal with lesson lengths that can vary from student to student, either 30, 45, or 60 minutes. I've set up a field for the lesson length formatted as radio buttons with each one of these values and I'm trying to complete a calculation based on these fields:

Count - the number of students in the family

Lesson Length - 30, 45, or 60 minutes

Lesson Charge per half hour

This would seem to be a good place to use the Choose function, or perhaps the Case function, but nothing I do will return the calculation based on changes to the Lesson Length field. I either get no result, or there is no change if I switch the Length buttons.

I'm sure it's probably a very simple oversight on my part.

Here is the formula I've been working with:

Choose ( Lesson Length = 30 ; Count * Lesson Chg * 1 ;

Lesson Length = 45 ; Count * Lesson Chg * 1.5 ;

Lesson Length = 60 ; Count * Lesson Chg * 2 )

Any help is greatly appreciated.

Posted

Your formula will work fine if you use Case instead of Choose.

Posted

If it will always be increments of 15 minutes, 15, 30, 45, 60, 75, 90, etc then it may be better if you use a simple calc like this:

Lesson Length / 30 * Count * Lesson Chg

or

Div ( Lesson Length; 15) * Count * ( Lesson Chg / 2 ) will charge in increments of 15 minutes. So, 40 minutes & 44 mins will still be charged at 30 minutes. Only when it hits 45 minutes will it charge for 45 minutes.

Posted

I just noticed that after I posted, but you beat me to it. Nice one.

Posted

Unfortunately, I did that earlier, and just now after reading your post, and the result is a blank field. Nothing. Is there some slight syntax error I'm missing?

J D Thomas

ThomaStudios

Posted

Aha. First off, thank you for the great suggestions. I was dealing with an mistake on my part that I didn't realize until this morning. For some stupid reason I had the Lesson Chg field formatted as a repeating field, which was totally unneccessary.

All the suggestions are working fine now. Plus, I learned something.

Thanks again.

J D Thomas

ThomaStudios

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