aapl Posted March 22, 2005 Posted March 22, 2005 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.
Ender Posted March 22, 2005 Posted March 22, 2005 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.
aapl Posted March 22, 2005 Author Posted March 22, 2005 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.
Ender Posted March 23, 2005 Posted March 23, 2005 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.
Ugo DI LUCA Posted March 23, 2005 Posted March 23, 2005 ...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.
comment Posted March 23, 2005 Posted March 23, 2005 How does that work? Do you mean a list view, with scrolling down to view the next day?
Ugo DI LUCA Posted March 23, 2005 Posted March 23, 2005 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.
comment Posted March 23, 2005 Posted March 23, 2005 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?
Ugo DI LUCA Posted March 23, 2005 Posted March 23, 2005 7 portals of 24 records based on One TO. Same is true for a Monthly View of Days actually...
comment Posted March 23, 2005 Posted March 23, 2005 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).
aapl Posted March 23, 2005 Author Posted March 23, 2005 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
Ugo DI LUCA Posted March 23, 2005 Posted March 23, 2005 Hi Comment, I'm not sure I'm understanding your question, nor where I should branch in this lenghty thread about Ranges...
Ugo DI LUCA Posted March 23, 2005 Posted March 23, 2005 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...
comment Posted March 24, 2005 Posted March 24, 2005 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.
Ugo DI LUCA Posted March 24, 2005 Posted March 24, 2005 I will do a template as I'm sure I'd gain as much from your comments than from the exercice itself...
Ugo DI LUCA Posted March 26, 2005 Posted March 26, 2005 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...
comment Posted March 26, 2005 Posted March 26, 2005 Yes, I would like to see the file - see your PM box.
Recommended Posts
This topic is 7551 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 accountSign in
Already have an account? Sign in here.
Sign In Now