Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

present and size functions

Status
Not open for further replies.

Mel162

Programmer
Apr 21, 2005
7
US
We are attempting to build a rule to populate a record field. We would like to be able to accomplish the following:

if (present(lookup (field 1,
condition 1 )) &
(size (lookup (field 1,
condition 1))) <= 9,
lookup (field 1,
condition 1),
input card 2 value )

We basically want to use one value if the size of field 1 is 1 to 9 inclusive and use a different value if size is 0 (field 1 not present) or it is greater than 9 in size.

We are having problems getting the logic to work. I am thinking that it is do to the multiple lookups against the same field and condition.

Any thoughts/suggestions on a work around to accomplish the task?
 
Well it might be a little hard to help debug without a better understanding of the actual rule and data structure but you could try this......

if (present(lookup (field 1, condition 1 )),
F_POPULATE_FIELD(lookup (field 1, condition 1 ), input_card_2_value),
input_card_2_value )

Then functional map 'F_POPULATE_FIELD' output rule would read......

if (size (input_card_1) <= 9,input_card_1, input_card_2)

At this point if you still have problems there could be an issue with your tree definition or something along that line. Try changing your if to something like.....


if (present(trimleft(lookup (field 1, condition 1 ))),
F_POPULATE_FIELD(lookup (field 1, condition 1 ), input_card_2_value),
input_card_2_value )
 
I think you're right about the multiple lookups. You could do individual lookups in different output cards or multiple rules in the same output card and check for the existance of these.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top