Creating a decay variable<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />I am looking to create a variable that will have a different value by time based on another, in this case to create Y.
For example:
time x y
1 10 10
2 0 5
3 0 2.5
Re: Creating a decay variableYou could use a column formula Y=10/(2^(Time-1)).
A table based on your example:
New Table( "untitled",
Add Rows( 4 ),
New Column( "Time",
Numeric,
Set Values( [1, 2, 3,] )
),
New Column( "X",
Numeric,
Set Values( [10, 0, 0] )
),
New Column( "Y",
Numeric,
Formula( :X[1] / 2 ^ (:Time - 1) )
)
)
Re: Creating a decay variableYou'll need to post a little more logic than that. As an example, from your post I might infer this:
For every record:
Copy X to Y
Output a result record
Until Y < .001
X = 0
Y = Y / 2
Output a result record
End