# calculation function on a value list

This topic is 7201 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

• Newbies

I have a field with 8 repeating text values called "Tour" (types of kayaking trips). I want to establish a script or calculation in the "Fee" field (city port fee) that queries the "Tour" field and returns a value in the "Fee" field based on whether the type of kayak trip listed/repeated in the "Tour" field uses a motor boat or not. If yes motor boat, then fee; if no motor boat, then no fee.

What seems to be failing is the repeating nature of the "Tour" field - niether script nor calculation recognizes the repeated values as a field.

Any advice to my friends ou there?

##### Share on other sites

Is Fee a repeating field with one "fee" per Tour entry?

-bd

##### Share on other sites

Post your calculation and we'll see what the problem is.

##### Share on other sites

• Newbies

Fee isn't a repeating value. It's either \$1.50 or \$0.0 (its a city tax per person on a motor boat using the harbor)

##### Share on other sites

• Newbies

Here's the calculation for the "Fee" field:

Case(Tour= "Fox Island AM" or "Fox Island PM" or "Thumb Cove Day" or "Thumb Cove Overnight" or "Aialik Bay Exploration" or "Fox Island Escape" or "Northwestern Fjord Exploration", 1.5*# of Clients,"")

All the tours listed within " " in the "Fee" calculation are tours that require a city port fee of \$1.50.

Within the"Tours" field, there are other tours listed as repeating values not included in the "Fee" calculation that do not require the port fee.

##### Share on other sites

First of all, you need a specific test for each Tour possibility, e.g. Case( Tour = "Fox Island AM" or Tour = "Fox Island PM" or Tour = "Thumb Cove Day", etc. ) or a combination of the tests, e.g. Case( PatternCount( "Fox Island AMFox Island PMThumb Cove Day...", Tour )... ).

Secondly, if you want to reference all the values in the repetitions in a non-repeating field, you need to use GetRepetition( field, repetition ), e.g. Case( PatternCount( "Fox Island AMFox Island PMThumb Cove Day...", Tour ) or PatternCount( "Fox Island AMFox Island PMThumb Cove Day...", GetRepetition( Tour, 2 ) ) or PatternCount( "Fox Island AMFox Island PMThumb Cove Day...", GetRepetition( Tour, 3 ) ), etc... )

##### Share on other sites

• Newbies

ok i'll chew on that one. i'm limping along on fmp 3.

thanks Q

##### Share on other sites

This topic is 7201 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account