Trying to "Count" the number of selections in a multi-select text field

  • 0
  • 2
  • Question
  • Updated 3 months ago
  • Answered

Hi,

I have a multi-select text field : [ERP Products]

I'm trying to have a Formula - Numeric field, to count the number of products that were selected.

I have tried something like this:

var Numeric ERPCounter = List(",",ToText[ERP Products]));   // to get the text list of the products, then have a "," delimited, so that the next (Count) function would work.

Then used:

Count($ERPCounter)

That doesn't seem to be working.

Trying to find a way to count those products. Any ideas?

Thanks!

Photo of George

George

  • 50 Points

Posted 3 years ago

  • 0
  • 2
This formula will require no maintenance.  Just don't have a semi colon in one of the choices though.



Try this

var text value = ToText([Multi select]);



Count(

Trim(Part($value,1,";")),

Trim(Part($value,2,";")),

Trim(Part($value,3,";")),

Trim(Part($value,4,";")),

Trim(Part($value,5,";")),

Trim(Part($value,6,";")),

Trim(Part($value,7,";")),

Trim(Part($value,8,";")),

Trim(Part($value,9,";")),

Trim(Part($value,10,";")),

Trim(Part($value,11,";")),

Trim(Part($value,12,";")),

Trim(Part($value,13,";")),

Trim(Part($value,14,";")),

Trim(Part($value,15,";")),

Trim(Part($value,16,";")),

Trim(Part($value,17,";")),

Trim(Part($value,18,";")),

Trim(Part($value,19,";")),

Trim(Part($value,20,";"))

)