Skip to main content
Question

Formula to count values in a field


I have a multi-line text field that clients use to input various Skus or Barcode values. The values can be scanned in or copy/pasted using various delimiters (comma, enter, space). I need another field that will count how many values were entered so that I can compare it to which values were returned. I'm having issues creating this field because they could enter any number of values (sometimes upwards of 250 values). Is this even possible?
This topic has been closed for replies.

Forum|alt.badge.img+17
Hi Rebecca,

So currently your clients are entering or putting in all of these SKUs and they aren't using one set delimiter? So it could be a comma, a space, or other character? There isn't anything consistent to help identify one entry from another?

Rebecca,
Here is a formula for up to 5, but you would need a lot of repetition to get it to count to 250!  I would suggest testing with say 5 or 10 to see if it would work for how your staff paste.


var Text parta = Part([paste target], 1, "\n ,");
var Text partb = Part([paste target], 2, "\n ,");
var Text partc = Part([paste target], 3, "\n ,");
var Text partd = Part([paste target], 4, "\n ,");
var Text parte = Part([paste target], 5, "\n ,");

Count(
$parta<>"",
$partb<>"",
$partc<>"",
$partd<>"",
$parte<>"")

It "works" but would be ridiculous to implement.... Is there no other way to count unique values in a field? 

I know that someone like Dan Diebolt who is on this forum from time to time would have a way to do this with the Image Onload Technique,  But it would only calculate on a form and not actually be a field which would be usable elsewhere on the app.