cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

To get sum of value present in between special character like '|'

nirupama
New Contributor II

Hello Community,

I need to get the sum of value present in between special character โ€˜|โ€™. Length of input may vary, one such scenario is attached. Please suggest.
Output getting after aggregate : โ€œNEUTSUMโ€: โ€œ261.02||697.13|359.22โ€
I need to get sum of those values.

1 ACCEPTED SOLUTION

marjan_karafilo
Contributor

Hi @nirupama ,

You can try the following expression:

$NEUTSUM.split('|').filter(x => x != "").reduce((accum, currentValue) => accum + currentValue, 0)

Let me know if this helps you.

BR,
Marjan

View solution in original post

2 REPLIES 2

marjan_karafilo
Contributor

Hi @nirupama ,

You can try the following expression:

$NEUTSUM.split('|').filter(x => x != "").reduce((accum, currentValue) => accum + currentValue, 0)

Let me know if this helps you.

BR,
Marjan

nirupama
New Contributor II

@marjan.karafiloski That helped me, Thank you!!