There are three scopes when dealing with calculated field expressions. The first scope is the global scope. Fields anywhere on the form (in a page, section, or any container) are considered global scope as long as they are not in a repeater field or nested table. The second scope is the repeater scope. This scope is in a repeater field or the top level of a nested table. The last scope is the sub repeater scope. This scope is the second level of a nested table.
From a field in the global scope, fields in the repeater and sub repeaters cannot be directly referenced in an expression unless it uses an aggregate. See Using Calculated Fields with Repeating Sections or Tables Repeaters for more information about aggregates.
Fields in the repeater scope can directly reference fields within the repeater scope within the same repeater/nested table and the global scope. Fields in the repeater scope cannot directly reference fields in the sub repeater scope unless it uses an aggregate. See Using Calculated Fields with Repeating Sections or Tables Repeaters for more information about aggregates.
Fields in the sub repeater scope can directly reference fields within the sub repeater scope, within the same nested table, the repeater scope within the same repeater/nested table, or the global scope.
If a direct reference is made that is supported as described above, the expression will not be valid.