dbTalk Databases Forums  

Field Contairner

comp.databases.filemaker comp.databases.filemaker


Discuss Field Contairner in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Darwin
 
Posts: n/a

Default Field Contairner - 10-24-2006 , 02:43 PM






Hello,

I being doing a calculation program but is not working it all.
this is what I want to do:
I have to field "Width" and "lenght" that are regular number fields,
fallow I have 4 check boxes "CC", "DD", "BB" and "Operable"
in the end I have 2 final fields "width2" and "lenght2" those are
calculations.

What I tray to do is when you enter a qty in Width, and if you pick one
of the three firts check boxes the qty changes in the width2; this can
be one of the other plus "operable". For the lenght is the same
operation.

This are the values for the check boxes: CC= -0.5, DD= -1, BB= +4 and
Operable= +1.

Here are the formula that I tray to use:
If(CC Dim="CC Dim",Width - 0.5, If(DD Dim="DD Dim",Width - 1, If(BB
Dim="BB Dim", Width + 4, Width))) and (If(Operable="Operable", Width
+1,Width))
please somebody help me.


Reply With Quote
  #2  
Old   
Ursus
 
Posts: n/a

Default Re: Field Contairner - 10-24-2006 , 02:59 PM






I don't know exactly what you are trying, but you have to look into the case
function. This will make your calc a lot easier to create and to use. All
these nested ifs are a pain to understand and figure out.

Case (
CC Dim="CC Dim",Width - 0.5,
DD Dim="DD Dim",Width - 1,
BB Dim="BB Dim", Width + 4,
Operable="Operable", Width +1,
Width )

"Darwin" <darwin (AT) gsiskylights (DOT) com> schreef in bericht
news:1161719013.267982.298250 (AT) m73g2000cwd (DOT) googlegroups.com...
Quote:
Hello,

I being doing a calculation program but is not working it all.
this is what I want to do:
I have to field "Width" and "lenght" that are regular number fields,
fallow I have 4 check boxes "CC", "DD", "BB" and "Operable"
in the end I have 2 final fields "width2" and "lenght2" those are
calculations.

What I tray to do is when you enter a qty in Width, and if you pick one
of the three firts check boxes the qty changes in the width2; this can
be one of the other plus "operable". For the lenght is the same
operation.

This are the values for the check boxes: CC= -0.5, DD= -1, BB= +4 and
Operable= +1.

Here are the formula that I tray to use:
If(CC Dim="CC Dim",Width - 0.5, If(DD Dim="DD Dim",Width - 1, If(BB
Dim="BB Dim", Width + 4, Width))) and (If(Operable="Operable", Width
+1,Width))
please somebody help me.




Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Field Contairner - 10-24-2006 , 03:28 PM



In article <1161719013.267982.298250 (AT) m73g2000cwd (DOT) googlegroups.com>,
"Darwin" <darwin (AT) gsiskylights (DOT) com> wrote:

Quote:
Hello,

I being doing a calculation program but is not working it all.
this is what I want to do:
I have to field "Width" and "lenght" that are regular number fields,
fallow I have 4 check boxes "CC", "DD", "BB" and "Operable"
in the end I have 2 final fields "width2" and "lenght2" those are
calculations.

What I tray to do is when you enter a qty in Width, and if you pick one
of the three firts check boxes the qty changes in the width2; this can
be one of the other plus "operable". For the lenght is the same
operation.

This are the values for the check boxes: CC= -0.5, DD= -1, BB= +4 and
Operable= +1.

Here are the formula that I tray to use:
If(CC Dim="CC Dim",Width - 0.5, If(DD Dim="DD Dim",Width - 1, If(BB
Dim="BB Dim", Width + 4, Width))) and (If(Operable="Operable", Width
+1,Width))
please somebody help me.
Although you can use multiple If statements, as you've discovered it
easily gets messy and too easy to make mistakes. You're also using an
'and' statement in a peculiar way that will give an unexpected result.

When you need multiple If statements like this you are best to use the
Case statement instead.

The Case statement takes the format:

Case(Test 1, Result 1,
Test 2, Result 2,
...
Test X, Result X,
Optional 'Otherwise' Result)

This allows you to run multiple tests and give appropriate results for
each one. Your calculation above would become:

Width2 {Calculation, Number Result}
= Case(CC Dim = "CC Dim", Width - 0.5,
DD Dim = "DD Dim", Width - 1,
BB Dim = "BB Dim", Width + 4,
Width)
+ If(Operable = "Operable",1, 0)



From you calculation, it looks like you've got the checkboxes as three
separate fields called DD Dim, CC Dim, and BB Dim. This can be a
problem since people can turn on the checkbox for more than one option
(eg. they can check DD Dim and BB Dim) which can cause unwanted
results.

Usually, but not always, it's best to have one field that uses a Value
List containing all the possible options.
eg.
DimType using Value List: CC Dim
DD Dim
BB Dim

This DimType field can then be put onto the layout and formatted as
Radio Buttons (not checkboxes). This way people can only turn on ONE of
the available options.

You can still test the data in the field using If or Case statements.
Your calculation above would then be:

Width2 {Calculation, Number Result}
= Case(DimType = "CC Dim", Width - 0.5,
DimType = "DD Dim", Width - 1,
DimType = "BB Dim", Width + 4,
Width)
+ If(Operable = "Operable",1, 0)






Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #4  
Old   
Darwin
 
Posts: n/a

Default Re: Field Contairner - 10-30-2006 , 10:16 AM




Thank's to everybody for your help!
I have everything done and working.
Thank's once a gain.

Darwin


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.