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

Recommended Posts

Posted

In a table i have a number of fields (defined for a calculation) named 100, 200, 300, 400 500, etc. and would like to be able to just copy and paste the same function for each one. For example if i had:

for the field named 100, --> If(table::price = "100" ; 1 ; 2)

for the field named 200,- -> If(table::price = "200" ; 1 ; 2)

I want to be able to substitute the name of the current field (not the active one, the one thats actually got the calculation in) where it says either "100" or "200" so I wont have to change it each time I copy and paste it.

Any suggestions would be greatly apreciated,

Thanks.

Posted

Just how many of these calc do you need? If there's a lot, then you may be better off using a related table for the prices. I'd offer more, but it's not clear what you're really trying to do.

Posted

I just used the If function as an example. What I'm trying to do is display appointments, so i have one table with appointments in:

date

client

time

stylist

service

and i want to display all of the appointments in another table "calender"

9000 (as in 9 o'clock)

9015

9030

9045

1000 etc.

I have related both tables so records in table "appointments" are related to table "calender" if the dates the same, now I'm trying to get the clients name to display in the correct field if they have an appointment.

Hope that makes things a bit clearer and i haven't complicated things.

Posted

For displaying a schedule, there's a couple possible ways to go.

1. You could use a portal to show the appointments for that calendar date, sorted by Start Time. This is the easiest.

2. You could use a separate relationship for each time slot, showing the related appointment record that is occupying each respective time slot. This is more work to set up a relationship for each 15 min time slot, but has the advantage of letting you quickly see the time slots that are used or open.

Posted

...And

3.Create (by script) as many records as days and as many time slots needed for each days...so that you only need one relationship for a day to view all slots at once in one portal only, and fill each when needed.

Posted

No. Or why not.

2 needs as many TOs as slots.

Instead, if you create one record for each needed slot for each day of your calendar, you will filter your calendar by day or week and display all slots at once with one TO only, may be involving several portals.

Of course, a 24 hours with 4 slots per hour for a calendar of 365 years will need 365*24*4 records per year where 2 only needs those filled with some data.

Posted

I think you can create the slots on the fly, so that shouldn't be a problem. But I still don't see how you're going to display those records. Say a week view, you have 7*24 hourly slots. With a single relationship, how are you going to split them into 7 columns?

Posted

Ok, I see. You're going back to Rob's method in the other thread. You need to run a script to get double bookings into the slots (since you cannot put a portal into a portal).

Posted

I did think of creating as many records as slots so i could use a portal to display empty and schedualed records but then im faced with the problem of sometimes having 2 records for one time slot because i don't want to have to search for the created record to edit it i just want to create a new one.

Also the records for appointments wont just have one time, they'll have a start and an end which complicates things further, at the moment i think i'll just have to use method 2 - create a relationship for each time slot. Has anybody got more info on how I'd do this?

thanks

Posted

Hi,

The slots Table or whatever you call it would not hold any event in my opinion.

The Events should be related to the slots, and if you want to see all events into each slot, then you could either use repeating fields or forget about a portal and only use repeaters...

Posted

My question is how do you show Events? I think I follow you up to the point where you have 7 portals of 24 rows with a single TO. It's actually ONE portal of 168 rows, broken into 7 columns, right?

This portal is from Calendar to Slots (or is it?). What fields are in the portal?

I am really struggling with this. Could I please beg you to explain this in more detail? MUCH more detail, if you would.

Posted

Hi,

I didn't have too much time today to work on it, but as far as the tests go, it works the way I have imagined.

Attached is the graph of the solution if it may help. I will try to go into a template tomorrow.

A "SlotsTable" consisting in 24 records with SlotID, timeStart and timeEnd, provides an alternative to a common time range relationship.

Each of the accounts will have a set of 168 records automatically loaded into a "WeekViewTable", which consist in 7 days * 24 slots of one Hour. Of course, we'd be using the slotID from our "SlotTable" here.

The main Date Range keys are set into the "UserTable", as well as a timeSlot range in case you want to see mornings and afternoon separately, or if you want to show only 12 slots at a time, and slide from 00:00:00 to 23:00:00.

The Date and Time ranges, when populated into the UserTable are passed to unstored calculations into the "WeekView" Table, and from there you'd be targetting the events and appointments related to any Date and TimeSlot from your inputs.

In the "EventsTable" is a list of related slotID from the startingTime and endingTime of any appointment. This list, auto-entered is indexed.

A rather complex calculation in the "EventsTable" produces a multilineKeyCode that *quickly said" will allow to split any appointment into several quarters of an hour as well as several slots of 1 hour.

In the WeekView table is a calculation targetting and parsing this related multilineKey so that the result is a repeating calculation that will be used to split each slot of the portal into 4 quarters.

According to the event type is a colour and you will therefore get a clear graphical view of your week schedule into this portal.

If you need to see the file, I can mail it to you, even if it is obviously a draft at the moment.

I really don't know when I will have time to go into it any further, unless tomorrow is calm...

SchedulerGraph.jpg

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