Skip to main content
insightsoftware Documentation insightsoftware Documentation
{%article.title%}
Published:
Was this article helpful?
0 out of 0 found this helpful

When...

Use this function to carry out a set of instructions each time the contents of a cell match a condition.

Do not confuse the When function with the If function:

Function Description

When

To carry out a set of instructions each time the contents of an intersection in a DataArea match a condition.

If

To carry out a set of instructions if any of the intersections in a DataArea matches a condition. In this case, the IF function carries out the instructions for all the intersections in that DataArea. (The IF function looks for a match of the condition and then applies the instructions to each and every intersection of the DataArea regardless of whether the remaining intersections in the DataArea match the condition.)

Syntax:

WHEN Condition

Instructions

[ELSE

Instructions2]

END WHEN

where:

  • Condition is a test to determine if a relationship is true or false. Your system tests the condition for every value of that symbol. When Condition is true, your system carries out Instructions.
  • Instructions is an instruction that your system carries out if Condition is true.
  • Instructions2 is an instruction that your system carries out if Condition is false.

Syntax example:

WHEN NetInc GE 1000

Invest = 0.2 "*" NetInc

END WHEN

Published:

When...

Use this function to carry out a set of instructions each time the contents of a cell match a condition.

Do not confuse the When function with the If function:

Function Description

When

To carry out a set of instructions each time the contents of an intersection in a DataArea match a condition.

If

To carry out a set of instructions if any of the intersections in a DataArea matches a condition. In this case, the IF function carries out the instructions for all the intersections in that DataArea. (The IF function looks for a match of the condition and then applies the instructions to each and every intersection of the DataArea regardless of whether the remaining intersections in the DataArea match the condition.)

Syntax:

WHEN Condition

Instructions

[ELSE

Instructions2]

END WHEN

where:

  • Condition is a test to determine if a relationship is true or false. Your system tests the condition for every value of that symbol. When Condition is true, your system carries out Instructions.
  • Instructions is an instruction that your system carries out if Condition is true.
  • Instructions2 is an instruction that your system carries out if Condition is false.

Syntax example:

WHEN NetInc GE 1000

Invest = 0.2 "*" NetInc

END WHEN

For an optimal Community experience, Please view on Desktop