Ambrit Posted April 18, 2008 Posted April 18, 2008 Hi, I want a script that will search my 8 field names, all numerical, and display the highest one on an invoice / new layout. I am a total beginner, so I thank you in advance!
mz123 Posted April 18, 2008 Posted April 18, 2008 I'm not sure if I'm clear on what you're asking for but if you want to compare the values in the 8 fields, you can create a calculation as follows: let( [ val1 = if( Field1 > Field2 ; Field1 ; Field2) ; val2 = if( val1 > Field3 ; val1 ; field3) ; val3 = if( val2 > Field4 ; val2 ; field4) ; val4 = if( val3 > Field5 ; val3 ; field5) ; val5 = if( val4 > Field6 ; val4 ; field6) ; val6 = if( val5 > Field7 ; val5 ; field7) ; val7 = if( val6 > Field8 ; val6 ; field8) ]; val7 ) Each "val" is comparing two numbers, choosing the highest and then the next "val" compares the previous number to the next number. In the end, you get the highest value out of the 8 fields. Does that do it?
mr_vodka Posted April 18, 2008 Posted April 18, 2008 Why not just use Max ( Field1; Field2; Field3; Field4; Field5; Field6; Field7; Field8 ) ?
mz123 Posted April 18, 2008 Posted April 18, 2008 I knew there was an easier way!! Thanks : I couldn't wrap my head around it this morning for some reason.
Recommended Posts
This topic is 6064 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