![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm looking to write a recursive function interpole some values with a table. Can someone figure if a function like this can be done with filemaker (Advanced 9)? |
#3
| |||
| |||
|
|
You can try one of these custom functions: http://www.briandunning.com/cf/108 http://www.briandunning.com/cf/844 I found it too, thanks... but they are not recursive. They work only on |
#4
| |||
| |||
|
|
Howard Schlossberg <howard (AT) nospam (DOT) fmprosolutions.com> wrote: You can try one of these custom functions: http://www.briandunning.com/cf/108 http://www.briandunning.com/cf/844 I found it too, thanks... but they are not recursive. They work only on one interpolation. I need a function that can be used on a indefinite number of values... I think it can be done with filemaker, but until now I wasn't able to do it. |
)
#5
| |||
| |||
|
|
In article <1jfvo8j.dnx2oe1dxqo21N%borgobello-NO (AT) SPAM-alice (DOT) it>, borgobello-NO (AT) SPAM-alice (DOT) it (Aladino) wrote: Howard Schlossberg <howard (AT) nospam (DOT) fmprosolutions.com> wrote: You can try one of these custom functions: http://www.briandunning.com/cf/108 http://www.briandunning.com/cf/844 I found it too, thanks... but they are not recursive. They work only on one interpolation. I need a function that can be used on a indefinite number of values... I think it can be done with filemaker, but until now I wasn't able to do it. You can set-up a Script to keep calling itself until it meets a particular "stop" value, although I'm not sure how many times it will do that. I did do a quick test FileMaker database for something like this a while back when someone else asked a similar question, but I can't find it now so I don't think I kept it. Helpful Harry ) |
#6
| |||
| |||
|
|
I would probably try something along the following line. Create a realationship where FieldA <= Value No, I need a function. I need it to permit to use it in editable |
#7
| |||
| |||
|
#8
| |||
| |||
|
|
Aladino <borgobello-NO (AT) SPAM-alice (DOT) it> wrote: This makes the job, but has the same "issue" as the prevouis: Interpola ( numero ; campoMultiplo1 ; campoMultiplo2 ; contatore ) = Let ( [ contatore=contatore+1; x1=GetRepetition ( campoMultiplo1; contatore ); y1=GetRepetition ( campoMultiplo2; contatore ); x2=GetRepetition ( campoMultiplo1; contatore+1 ); y2=GetRepetition ( campoMultiplo2; contatore+1 ); x3=GetRepetition ( campoMultiplo1; contatore+2 )]; Case ( x1="?" or x2="?" or y1="?" or y2="?"; "?"; x1="" or x2="" or y1="" or y2=""; ""; numero ? x1; y1; numero ? x2; (numero-x1)/(x2-x1)*(y2-y1)+y1; x3 = "?" or x3=""; y2; Interpola ( numero ; campoMultiplo1 ; campoMultiplo2 ; contatore ) )) -- |
#9
| |||
| |||
|
#10
| |||
| |||
|
|
Ursus <ursus.kirk (AT) ziggo (DOT) nl> wrote: Unicode did some joke. Here is the corrected function: Interpola ( numero ; campoMultiplo1 ; campoMultiplo2 ; contatore ) = Let ( [ contatore=contatore+1; x1=GetRepetition ( campoMultiplo1; contatore ); y1=GetRepetition ( campoMultiplo2; contatore ); x2=GetRepetition ( campoMultiplo1; contatore+1 ); y2=GetRepetition ( campoMultiplo2; contatore+1 ); x3=GetRepetition ( campoMultiplo1; contatore+2 )]; Case ( x1="?" or x2="?" or y1="?" or y2="?"; "?"; x1="" or x2="" or y1="" or y2=""; ""; numero =< x1; y1; numero =< x2; (numero-x1)/(x2-x1)*(y2-y1)+y1; x3 = "?" or x3=""; y2; Interpola ( numero ; campoMultiplo1 ; campoMultiplo2 ; contatore ) )) The first two case exit the script if repeating filed is ended (returns "?") or if it has an empty cell. To not use repeating fileds I tried to do the same with variables, it works too, but I don't like do define previously the variables, without giving the user the ability to change wich of them to use in calculations he should be able to write in text fields and that my script will evaluate. My idea is to give to users a reference with all usable variables, so they can change calculation without touching scripts or definitions. Script using variables is this: InterpolaV ( numero ; contatore ) = Let ( [ x1=$TabH1[contatore]; y1=$TabH2[contatore]; contatore=contatore+1; x2=$TabH1[contatore]; y2=$TabH2[contatore]; x3=$TabH1[contatore+1]]; Case ( x1="?" or x2="?" or y1="?" or y2="?"; "?"; x1="" or x2="" or y1="" or y2=""; ""; numero =< x1; y1; numero =< x2; (numero-x1)/(x2-x1)*(y2-y1)+y1; x3 = "?" or x3=""; y2; InterpolaV ( numero ; contatore ) )) This second function has the disadvantage that user can't decide wich will be second serie of values (y) inside the calculations, and I must add a field in which they can select this serie of values... Did you have any other idea how to make users able to input calculations, some with interpolations, some other that will look completly different? All of this calculation will be tha way user will be payed for his job, and should be printed in a sort of "job assignment" -- Per rispondere, togliere -NOSPAM- dall'indirizzo. |
![]() |
| Thread Tools | |
| Display Modes | |
| |