how do i write a complex expression

B

bobotie

I need to mulitiply an amount from a REF Field by 3. If the product is less
than and equal to $100. then $100. If the product is greater than and equal
to $500., then $500. If the products falls between $100. and $500 then the
calculated amount should be entered
 
T

Tony Jollans

Sorry, to show dollars, do this ..

{ = min(max({={ref whatever}*3}, 100), 500) \# "$0"}

This may not give what you want if you can have negative values in the
referenced field. post back if that's the case.
 
B

bobotie

Thanks, this helped a lot. How do i find the reference field # or name for
this expression? I need to calculate the sum of 4 field results, one of
which includes this field expression.
Thanks again
bobotie
 
T

Tony Jollans

Hi bobotie,

It doesn't have a name at the moment. If you want to give it a name, change
it to ..

{ set abcd { = min(max({={ref whatever}*3}, 100), 500) }}

This won't display anything, just set abcd to the value. If you also want it
to display either do ...

{ quote { set abcd { = min(max({={ref whatever}*3}, 100), 500) } { abcd \#
"$0"}}

... or, more simply perhaps, ...

{ set abcd { = min(max({={ref whatever}*3}, 100), 500) }} { abcd \# "$0" }
 
B

bobotie

Tony
Does set abcd mean name expression abcd or anything i choose? If so, in my
total field i would write for example =sum(Text1, Text2, Text3, abcd)?
I'm new to this, my apologies for not getting it.
Am leaving for the day and will check back monday
Thanks, enjoy
bobotie
 
T

Tony Jollans

Hi bobotie,

abcd can be any name you choose - I just used abcd as an example.

Have a good weekend!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top