4 Replies Latest reply on May 11, 2013 7:58 AM by DaveM

# Conditional content within a field

### Title

Conditional content within a field

### Post

So, I tried searching, but I'm kind of unsure as to how to put my question into a "searchable" context. I don't thnk that what I'm looking for is a conditional value list -- but I'm a newb, so maybe I'm wrong about this.

What I have is a database that tracks hourly wages, based on projections for the type of work being done on a given day. The type of work day is designated in a field with a value list, IE: "rehearsal", work, prep, etc. I also have totals being generated for everyone working on a given day, so I know what they're making for an eight hour day and a twelve hour day. What I need is a field that looks at the first field (for the type of work -- say, "rehearsal") and will return the "eight hour day" total, but if the first field says "work" it will return the total for the "12 hour day."

Any help would be really appreciated.

• ###### 1. Re: Conditional content within a field

To answer that question requires a more detailed understanding of how you have organized your data.

How, at least "on paper", are the 8 hour day and 12 hour day totals computed?

Are you computing actual hours worked from a list of people who have "clocked in" in some manner or are you computing an estimated value based on the number of people?

• ###### 2. Re: Conditional content within a field

Hi Phil,

As far as the numbers go, I have a field that calculates each worker at an hourly rate -- ie: \$10 per hour for 8 hours is \$80. I also have a field that calculates, for example, time and a half after 8 hours -- ie: \$10 per hour for 8 hours plus 4 hours at \$15 per hour (12 hour day) is \$140. I have an additonal summary field that aggrigates the totals for all of the manpower for the day, based on the previously mentioned timeframes -- ie: 10 guys for 8 hours is \$800, 10 guys for 12 hours is \$1400.

What I have is actually a little more complicated, as there are both time and a half and double time considerations, so the above is just for simplicity's sake. All those fields are functioning fine.

This budget is for a projected project, so it's not actual hours, but what we're estimating -- so, a "rehearsal day" will be assumed to be an 8 hour day, and a "work" day would be a 12 hour day. Each day is an "Event" which has a field that designates it as one of these categories.

What I'm hoping to be able to do is to create a summary budget that shows a projected cost for manpower for the day, and to have the total in the field controlled by the day's designation as a rehearsal day or a work day. I've got everything functioning to this point -- other than having the DB automatically store the correct amount.

Thanks!

• ###### 3. Re: Conditional content within a field

Is this all in one record (all employees get the same rate?) or do you use a related table to list individuals and their pay rates?

If this is all in one record where you would specify the number of people, the type of "day" and also have your calculation fields, then all you need is a calculation field with an If or Case function that selects the correct calculation field for the type of day:

If ( DayType = "work" : 12HourDayCalc ; 8HourDayCalc )

If you have more than two types of days, use Case in place of If.

• ###### 4. Re: Conditional content within a field

Fantastic! Thanks!