This tool is intended for use in ModelBuilder, not in Python scripting.
The Expression parameter only supports Python expressions. Other scripting languages are not supported.
Use the Expression parameter for short one line expressions. Use the Code Block parameter for more complicated expressions, such as multiline calculations or logical operations (if, then). The Code Block parameter cannot be used on its own; it must be used in conjunction with the Expression parameter.
See examples of using the Expression parameter.
Variables created in ModelBuilder can be used by this tool, but variables cannot be connected directly to the Expression parameter. To use a variable in the expression, enclose the variable name in percent signs (%).
You cannot access model variables in the Code Block parameter. These variables must be passed to the code block from the expression. To do this, create a function definition in the Code Block parameter and reference the definition in the Expression parameter.
See examples of using the Code Block parameter.
The Data Type parameter is used in ModelBuilder to help chain the output of the Calculate Value tool with other tools. For example, if you use the Calculate Value tool to calculate a distance for use as input to the Buffer Distance parameter of the Buffer tool, specify Linear Unit for the Data Type parameter.
See examples of using the Data Type parameter.
In Python, proper indentation is part of the syntax. The indentation level (two spaces or four spaces) does not matter as long as it is consistent throughout the code block.
When writing equivalent Python scripts, use standard Python statements instead of using the Calculate Value tool.