Math. on one parameter, if another is

Hey there, i have these two lists. They are parameter from the same windows.

I want to make a little math. the math depends on the Orient parameter. So for example, all that have south west, gets * 0.8

How do map this in the most effecient way?

Put your 8 Orientation strings into a Dictionary with the corresponding calculation factors. Read the Area and orientation, ask Dictionary for the factor, multiply area.

1 Like

Sounds good, i never used dictionary, can you show me how that goes?

Both links took me 10 seconds to find using Google.

Do some research and give it a try.

@Pedeh You can use dictionary as shown below

Or do something like this

Using a dictionary is more efficient and usually recommended.
However, using the 2nd method should almost be equally efficient if you have a smaller set of elements.

And if you just need to define the factor for 1 direction, use the if condition like this

1 Like

Thx for making me aware :slight_smile:

This was a quick and awesome way to learn, the Dictionary part, more than the primer has to offer :slight_smile: Thx a ton.

1 Like