title: Repeat the value if belongs to same group
body: <p><a href="https://i.stack.imgur.com/y5VxH.jpg" rel="nofollow noreferrer">Possible outcomes of the formula</a>Hi all,
  I am seeking some help to repeat the field name within the same group as shown in the image. I have used the following formula to create Via:</p>
  
  <pre><code>shared numbervar counter;
  If {Command.ACTIVITY}= 'Pick' and 
  (previousISNULL ({Command.PASSONBOARD}) or previous 
  ({Command.PASSONBOARD})="")
   and next ({Command.ACTIVITY})='Pick'
   then (
   counter := counter + 1;
   "Via" + cstr(counter))
    else ""
  </code></pre>
  
  <p>I would appreciate the help. Thanks</p>