Adding only UNIQUE() values in a subtable column

I am trying to sum all unique numbers from a subtable column. In other words, if a number is repeated in the subtable column, I want to only add it once and ignore all repeating instances of that number. Any suggestion on how to do this? UNIQUE(A1,“+”) does not work.

Hi,

Currently it’s not supported to do this kind of calculation by existing formulas. You will have to achieve it by writing javascript.
https://www.ragic.com/intl/en/doc/15/Javascript-Workflow-Engine

It’s my understanding that JS only updates field values with a button or when saving the record… there is no automatic calculation as fields are typed, is that correct? So I don’t think this solution is workable in my situation. I need the sum to be dynamically updated as the user enters data.

Hi,

You are correct, no, currently it’s not supported.

Hi,

If you only need to “display” this kind of result to your users that you don’t really need this calculated result to be saved in the database as numeric values, you can consider following below workaround:

1, Create a “Free Text” field
2. Assign formulas to combine the string of formulas BBcode and UNIQUE() function as below:
image
And it can return the displayed amount as you need:
image
But the real value saved in this field is the formulas BBcode instead of the numeric values:
image

1 Like

Brilliant! Thanks for the suggestion.

I took your concept a step further and formatted the field output for money:

‘$’+‘[formula]’+‘ROUND(’+UNIQUE(S13,‘+’)+‘,2)’+‘[/formula]’