Jump to content

calculation function on a value list


sunnycove

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?

Link to comment
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.

Link to comment
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... )

Link to comment
Share on other sites

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.