Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Over laying fields

Status
Not open for further replies.

fmpuser

Technical User
Feb 19, 2006
10
US
Is there any consequence to overlaying (2)fields when data will never be in both fields at the same time? I tried to figure out a "IF" statement to bring data from one field into another but I already had an "IF" statement for the main field and ran short on time to figure how to accomplish a "Double IF". I'm sure the solution was right at hand but the field overlay was a quick fix and seems to be working ok so far as data calculates properly for all displayed values.

M. Austin
Fleet Mgr
Sunniland Corp
 
The big problem I can think of comes into play when you try to enter data into either of the fields. It's going to go to the one on the top first. That may or may not be the correct field.

If you're not entering data into or searching either of the overlayed fields you shouldn't have a problem.

You could also post your logic in plain english and I could take a swing at writing the calculation. If you do please include Windows or Mac, and what version of FM you're running.

-Striker
 
Thanks Striker for your valued input - apologize for ommiting some essentials:

FMP version is 8.0
OS = XP Pro

Scenario: have 3 types of truck drivers, in house, local contractors and freelance contractors. One of the functions of my DB is to tract costs of each. The values for the "in house" driver is a calculation based on a handful of criteria and placed in a Total Costs field. In the field for local contract drivers (sub contractor field)there is an "if" statement" If(GetAsNumber(TOTAL COSTS)>"0";"";(MILES*RATE)*(FSC)*.01+(MILES*RATE)+ Drops*50)" that looks at the total costs field - if there is a value there the sub-contractor field will show blank (no zeroes or question mark). If the Total Costs field is blank then a calculation is performed to determine total sub-contractor costs based on several criteria. Now here is where the problem comes in - for the "Freelance" driver there is no calculating criteria; they give me a bill and I pay it but I would like to display that amount in the same field as the "Subcontractor Costs" and I did this by just overlaying one field over the other. Since a load can only be delivered by one entity there is no way I can think of that the two will ever conflict with each other.

Have I got you totally confused yet? Do you see any issues that I have overlooked? And last but not least, is there a cleaner way to do all this?

Thanks for you input...






M. Austin
Fleet Mgr
Sunniland Corp
 
Addendum to my last: I use an input form to add values and all fields are separated - its only in the "List" display where I have one field overlayed on another.

M. Austin
Fleet Mgr
Sunniland Corp
 
I would use a Case statement to check first the truck driver type, and act in accordance.

Something along these lines:
Case(
TypeDriver="In House";Total Cost;

TypeDriver="local contractor";GetAsNumber(TOTAL COSTS)>"0";"";(MILES*RATE)*(FSC)*.01+(MILES*RATE)+ Drops*50;

TypeDriver="freelance";amountInvoice
)

This will give you the result in accordance with the type of driver.
 
Thanks Striker - I had no doubt that you could provide a cleaner formula. I'll try later on today to incorporate it and will let you know the results...

M. Austin
Fleet Mgr
Sunniland Corp
 
Sorry, I sort of hi-jacked TStriker posts on this item....
 
What a dummy I am - did not even take notice of who responded. Thanks for the great tip Jean - I humbly apologize for mis-directing the credit. Hope I can tap your talent in the future as FMP has just sucked me in over the years but still have lots to learn about it. Mike

M. Austin
Fleet Mgr
Sunniland Corp
 
Well...I have to apologize to TStriker for just jumping in, it's not my habit, TStriker is a well respected member and a top notch developer and I'm sure the thinking path for a solution will be the same as mine.

But after more than 15 years in development in the 'transport' sector, I couldn't resist when I saw 'truck' and 'driver'....
 
BTW Mike, I copied to much:

read

TypeDriver="local contractor";GetAsNumber(TOTAL COSTS)>"0";"";(MILES*RATE)*(FSC)*.01+(MILES*RATE)+ Drops*50;

as

TypeDriver="local contractor";(MILES*RATE)*(FSC)*.01+(MILES*RATE)+ Drops*50;

The first part of the If statement is not needed.

Now who's the dummy here....:)

 
Hi Jean,

I'm not offended at all on your answering the question. Truth is I got busy on lots of other things and wasn't able to get back any sooner so thanks for taking over. M. Austin got his answer quicker and that is really what it is all about. Feel free to chime in anytime!

-Striker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top