Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

calculate add and subtract to same cell?

Avatar

Former Community Member

I have created a table that has numeric fields in them. I am trying to calculate from two fields and generate result in to one cell. for example, first column cell starts with beginning quantity, second column cell is to type number of quantity to remove from the beginning cell and third column to add to the beginning cell. the calculation should be populated in the fourth column cell. I am able to create add calculation script to fourth cell by just adding — Sum(begin1+add1) — but can’t figure out subtract to the same field.

sample.jpg

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

// form1.page1.subform1.table.row[0].total::calculate - (FormCalc, client)

$.rawValue = a + b - c

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

// form1.page1.subform1.table.row[0].total::calculate - (FormCalc, client)

$.rawValue = a + b - c

Avatar

Former Community Member

You are the best Steve!!! Thanks for your help

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----