### Title

Calculation field and value list

### Post

I have value list with elements for example 50(%), 50(%), 50(%), ...

I have field "x" = 100

How to create calculation field that calculate:

y = x+(x*first element of value list*0,01)

y = y+(y*next element of value list*0,01)

y = y+(y*next element of value list*0,01)

example:

value list: 50, 10

x = 100

result: y = 165

value list: 50, 50, 50

x = 100

result: y = 337,5

Why use a value list for this? (There are a number of easier ways to put your values into a list of return separated values without defining a value list to do so.)

In a script, you can calculate it like this:

Set Variable [$Values ; value: ValueListItems ( Get ( FileName ) ; "ValueListNameInQuotesHere" ) ]

Set Variable [$Y ; YourTable::Xfield]

Loop

Set Variable [$I ; Value: $I + 1]

Exit Loop If [$I > valueCount ( $Values ) ]

Set Variable [$Y ; Value: $Y + $Y * GetValue ( $Values ; $I )/100]

End Loop