1. Registered User
Join Date
Feb 2004
Posts
7

Hi everybody !

If(Status(CurrentDate) ? soldesline::datestart and Status(CurrentDate) ? soldesline::dateend; soldesline::field1; 0)

This calculation works: the condition is based on the current date compared to a start date and an end date, if the test is true, the value of the field "field1" appear in the calculation field.
But i want the calculation field to return other values from other fields, not only field1, based on another condition.

I will name these fields: field 1, field 2, field 3 which can be text or numeric field and contain a % value, so a number.
The values are always as follows:
field1 value < field2 value < field3 value
I want my calculation field to choose the field3 if there is a not null value in it, if not the field2, if not the field1, if all are empty, returns 0.

So i tried with a max because in fact, i always want the max value to be used but it doesn't work.
On another way, I tried to add conditions with logical functions IsEmpty, IsValid, inside a Case or a If function, i suppose it can work but perhaps my formula wasn't really valid.

Finally, can someone help me to write this calculation field ???
Many thanks in advance and congratulations for this forum !

2. Registered User
Join Date
Sep 2003
Location
Cincinnati, Oh USA
Posts
203

## Re: conditional calculation field

If(fld3 = "",fld2, If(fld2 = "",fld1,fld3))

Originally posted by webcargo
Hi everybody !

If(Status(CurrentDate) ? soldesline::datestart and Status(CurrentDate) ? soldesline::dateend; soldesline::field1; 0)

This calculation works: the condition is based on the current date compared to a start date and an end date, if the test is true, the value of the field "field1" appear in the calculation field.
But i want the calculation field to return other values from other fields, not only field1, based on another condition.

I will name these fields: field 1, field 2, field 3 which can be text or numeric field and contain a % value, so a number.
The values are always as follows:
field1 value < field2 value < field3 value
I want my calculation field to choose the field3 if there is a not null value in it, if not the field2, if not the field1, if all are empty, returns 0.

So i tried with a max because in fact, i always want the max value to be used but it doesn't work.
On another way, I tried to add conditions with logical functions IsEmpty, IsValid, inside a Case or a If function, i suppose it can work but perhaps my formula wasn't really valid.

Finally, can someone help me to write this calculation field ???
Many thanks in advance and congratulations for this forum !

3. Registered User
Join Date
Feb 2004
Posts
7