SWITCH to assign a value to another column and output a text value for the current column.

I use switch to define the Initial Value. The problem is that I have 2 columns that can be defined with one formula and I don't want to call the same formula for the Initial Value of the other column. I would like to use switch to assign a value to the other column and the current column where I used the formula. I tried this but instead of assigning a value it just compares the value to the one I want to assign.

I call this formula in the Initial Value of the [Amount] column.

SWITCH([Type],

"Replacement", ([_THISROW].[Status]="Unpaid", [_THISROW].[Amount]="1.00"),

"Exchange", ([_THISROW].[Status]="Waived", [_THISROW].[Amount]="1.00"),

([_THISROW].[Status]="No Fee", [_THISROW].[Amount]="0.00"))

Please help me to understand the syntax for performing several actions.

 

Solved Solved
0 6 482
1 ACCEPTED SOLUTION

As it is written clearly in the document of the function switch, the only thing you can specify as it's return object is a value.

Appsheet does not provide a full blown programming language like Java.

If you absolutely need to reduce the amount of computation within app sheet then you might want to consider using Google apps script to calculate your results and update the row through app sheet API.

View solution in original post

6 REPLIES 6