# Thread: Lowest of three fields

1. ## Lowest of three fields

Hi ... a little help please. In a report I want to display the data from the lowest of three fields. e.g.:

Field A = 131
Field B = 130
Field C = 127

I want to display the value of Field C i.e. 127

Do I use a Calculated field and if so what would be the expression or is the a better/easier solution?

Thanks

2. ## Re: Lowest of three fields

CalculatedField = *min(FieldA.value+crlf()+FieldB.value+crlf()+FieldC.value)

3. ## Re: Lowest of three fields

could do calcField = case(a<b,min(a,c),b<a,min(b,c))

4. ## Re: Lowest of three fields

Thanks for the help guys both worked ....

Allen ... It took me a moment to realise that as the field are are already numeric I didn't need the .value

Greg .... your suggestion calcField = case(a<b,min(a,c),b<a,min(b,c)) works for three fields.

I have not use "case" before so if there are four fields would it be calcField = case(a<b,min(a,c),b<a,min(b,c),c<a,min(c,d)) ?

Thanks again

5. ## Re: Lowest of three fields

Hi John,

Sorry about the confusion. I offered that suggestion specifically because you were asking about lowest value of 3 fields.
With that said, you would need one extra comparison to make this work.
calcField = case(a<b,min(a,c),b<a,min(b,c));calcField = min(calcField,d) does the trick.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•