title: Is it possible to add more than two attributes/operands in Update Expression to SET another attribute in DynamoDB?
body: <p>I am trying to store in a column in DynamoDB table a numeric value that is the addition of other numeric columns in that table.</p>
  <p>I read this: <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html</a> and while it seems to not explicitly mention that more than two operands cannot be joined with the &quot;+&quot; operation in a row, it does fail when I try to do so.</p>
  <p>While I probably should not be storing in columns values that are aggregated values, and only have columns that store granular values, but is there a workaround here?</p>
  <p><strong>Edit:</strong>
  Here's what I am trying to do</p>
  <pre><code>aws dynamodb --endpoint-url http://localhost:8042 update-item --table-name custom_table --key &quot;{\&quot;main_part\&quot;:{\&quot;S\&quot;:\&quot;hash_key\&quot;},\&quot;sort_part\&quot;:{\&quot;S\&quot;:\&quot;range_key\&quot;}}&quot; --update-expression &quot;SET #A = #B + #C + :val&quot; --expression-attribute-names &quot;{\&quot;#A\&quot;:\&quot;column_1\&quot;,\&quot;#B\&quot;:\&quot;column_2\&quot;,\&quot;#C\&quot;:\&quot;column_3\&quot;}&quot;  --expression-attribute-values &quot;{\&quot;:val\&quot;:{\&quot;N\&quot;:\&quot;10\&quot;}}&quot;
  </code></pre>
  <p>This gives the following error:</p>
  <pre><code>An error occurred (ValidationException) when calling the UpdateItem operation: Invalid UpdateExpression: Syntax error; token: &quot;+&quot;, near: &quot;#C + :val&quot;
  </code></pre>