Help required understanding/resolving a circular definition

Hi,

Please could someone give me a hand understanding a circular definition issue.

I’ve created a VC helper-column called [FINDMAXROW] to house an expression that I need to re-use several times an Initial Value in a form.

[FINDMAXROW]

IF(

		[survey_type] = "Node",

MAX(
	SELECT(
		survey[_ROWNUMBER],
	AND(
		[survey_type] = "Node",
        [_THISROW].[LCS] = [lcs],
        [_THISROW].[select_cabinet_to_survey] = [select_cabinet_to_survey],
        [_THISROW].[select_asset_type] = [select_asset_type],
	    NOT([branch_info] = "new branch")
		))),

IF(

    [survey_type] = "Cable",

MAX(
	SELECT(
		survey[_ROWNUMBER],
	AND(
		[survey_type] = "Cable",
        [_THISROW].[LCS] = [lcs],
        [_THISROW].[select_cabinet_to_survey] = [select_cabinet_to_survey],
        [_THISROW].[select_asset_type] = [select_asset_type],
	    NOT([branch_info] = "new branch")
		))),
    ""
    ))

.
.
Testing [FindMaxRow] VC in the Expression Assistant yields the correct result and shows max row 2 for “node” and max row 12 for “cable”


.
.
I then apply it as an Initial Value like this in the [survey_type] column:

LOOKUP([_THISROW].[FINDMAXROW],"survey","_ROWNUMBER","survey_type")

.
Testing [survey_type] Initial Value in the Expression Assistant yields the correct result and shows “node” and “cable” in the right places


.
.
However, saving the app presents a circular definition error on the [survey_type] column:

Here’s the survey table if it helps:

Solved Solved
0 6 1,105
1 ACCEPTED SOLUTION

Try removing [_THISROW].

[_THISROW]. is used inside SELECT() or FILTER() expressions to reference back outside of the SELECT/FILTER.

But LOOKUP()'s first parameter is in the same context as the table already, so you can reference it directly.

LOOKUP([FINDMAXROW],"survey","_ROWNUMBER","survey_type")

I’m not sure if this is the only issue though. This seems like separate cause. But then you did have 3 errors to start with, so…

View solution in original post

6 REPLIES 6
Top Labels in this Space