Using other parameters in the dynamics wizard

15 views
Skip to first unread message

Bob Watzlavick

unread,
Oct 26, 2009, 4:39:43 PM10/26/09
to IADS
One of our users wants to set the background color of a text control
based on some logic that depends on two other independent parameters.
Well sort of - one of the two in the equation is the one that is
dropped onto the fill color property and the other parameter is an
independent parameter. Is this supposed to work or do we need to make
a regular derived parameter that computes a single color and have that
drive the Fill Color.

So, the generic version of this question is: Can you use other
parameter names in the table lookups in the dynamics wizard? What
about the Numerical Equation form of the dynamics wizard?

Here's an example of what we're trying to do for the Fill Color in the
dynamics wizard:

OtherParam==1 && value < 100 black
OtherParam==1 && value >= 100 && value <= 180 yellow
OtherParam==1 && value > 180 red
OtherParam==2 && value < 40 black
OtherParam==2 && value >= 40 && value <= 60 yellow
OtherParam==2 && value > 60 red

Assuming we go with a separate derived parameter, other than making a
big if/then/else statement, is there a better way to do this?

Thanks,
-Bob

Brenda Rasmussen

unread,
Oct 26, 2009, 5:52:23 PM10/26/09
to IADS
Hi Bob,

On Oct 26, 1:39 pm, Bob Watzlavick <robert.l.watzlav...@lmco.com>
wrote:
> One of our users wants to set the background color of a text control
> based on some logic that depends on two other independent parameters.
> Well sort of - one of the two in the equation is the one that is
> dropped onto the fill color property and the other parameter is an
> independent parameter.  Is this supposed to work or do we need to make
> a regular derived parameter that computes a single color and have that
> drive the Fill Color.
>

Unfortunately, I don't think this will work. I believe the Dynamics
Wizard will only use the parameter that is dropped on the property.

> So, the generic version of this question is:  Can you use other
> parameter names in the table lookups in the dynamics wizard?  What
> about the Numerical Equation form of the dynamics wizard?

Probably not. I just tried it and unless there is some magic formula
that I'm not aware of, it won't work.

>
> Here's an example of what we're trying to do for the Fill Color in the
> dynamics wizard:
>
> OtherParam==1 && value < 100                                 black
> OtherParam==1 && value >= 100 && value <= 180     yellow
> OtherParam==1 && value > 180                                  red
> OtherParam==2 && value < 40                                   black
> OtherParam==2 && value >= 40 && value <= 60       yellow
> OtherParam==2 && value > 60                                   red
>
> Assuming we go with a separate derived parameter, other than making a
> big if/then/else statement, is there a better way to do this?

I wish I could answer yes. Jim might chime in with a better solution,
but the tried and true brute force method of an if/then/else statement
will always work.

Sorry Bob. We'll have to think about this one to see if it's feasible
to do something like this in the future.

Brenda


>
> Thanks,
> -Bob

Jim Bretz

unread,
Oct 26, 2009, 10:16:10 PM10/26/09
to ia...@googlegroups.com
Hi Bob,

Let me comment further on what Brenda already mentioned.

> One of our users wants to set the background color of a text control
> based on some logic that depends on two other independent parameters.

Whenever you have a property that needs to be driven by more than one
parameter, you'll need to use a derived parameter. The challenge is to
combine the pair into an equation that can used by the dynamics system
to get the desired results.

> Assuming we go with a separate derived parameter, other than making a
> big if/then/else statement, is there a better way to do this?


There are many ways to do this.

Actually you can combine the two parameter's value into a unique
single value. At that point you can then check the value un the
dynamics.

For instance: param1 * 1000 + param2

Once you have a derived parameter with the above equation you can drop
this into the background color property and then build a range dynamic
set. From 1000 to 1099 is black, 1100 to 1150 yellow, and so on. Make
sense?

Another option is to simply drive this equation into an interpolate1d
function and simply return the desired color

Interpolate1d( param1*1000+param2, "1099,0x000000,1150,
0xFF00FF, ........

As you mentioned, you could also create a large IfThen statement and
simply return the color. That might be easier to read and edit.

Hope this helps,
Jim

>

Reply all
Reply to author
Forward
0 new messages