Forum Discussion

nirupama's avatar
nirupama
New Contributor II
3 years ago
Solved

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

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 ...
  • marjan_karafilo's avatar
    3 years ago

    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