Visokio website     Downloads     Video tutorials     KnowledgeBase  
Counting ; characters - Visokio Forums
Counting ; characters
  •     schergr March 16, 2012 1:25PM
    Is there a way to count the # of instances of ; in a static field? I tried to do search(";",[field_name]) but it returns something like 16, when the answer should be 3. I made sure to set the field type to integer and the value type to "formula result"
  • 3 Comments
  •     michael March 16, 2012 1:41PM
    Hi Greg,

    Could you attach here an example IOK file?
  •     indranildatta March 16, 2012 1:43PM
    If you are looking for a formulae, here is something that can possibly work:

    LEN(REPLACEREGEX([Field],"[^;]","", false))

    Cheers!
    Indranil
    Indranil Datta
    Invizua Limited - www.invizua.com - Dedicated to Media, Marketing Services and Market Research Organisations
    M: +44 7956 470 046 | E: indranil.datta@invizua.com | Skype: indranildatta1 | LinkedIn: www.linkedin.com/in/indranildatta | Twitter: @indranildatta

    Address: Studio 6, 36-42 New Inn Yard, London EC2A 3EY
  •     chris March 19, 2012 8:04AM
    Hi,

    Indranil's solution is a good one.

    The reason why the "SEARCH" operation wasn't working was that SEARCH returns the number of the character which your string is first found. So if you execute SEARCH(";",[field_name]) and it returns 16, this means the character ";" first appears as the 16th character. It does not mean that it occurs 16 times.

    It might be useful for us to implement a "COUNTTEXT" function which does what your requesting.

Welcome!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership