cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to count the individual values in a multiple value field?

former_member279138
Participant
0 Kudos

I have a multiple value field in which I need to count each value. The number of multiple values ranges from 1 to 6. No matter how many values there are they are always surrounded by ampersands so if there is just one value it presents as &AAA& if they are two it presents as &AAA&BBB& and so on. But of course there are multiple possibilities so it won't always start off as &AAA& sometimes it will be &CCC& or sometimes it will be &EEE&DDD&

I already am running a formula to split the values to display them. (The present in different columns) My next question is how do I count the individual values for each type of value. So I need to count all the AAA and BBB and CCC and so on across the multiple fields.

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Kurt,

Just like you have several formulas for each Column, you need as many formulas for the count.

Here's an example of how the Count formula for Column 1 would look like:

EvaluateAfter({@Formula_Name_Column_1}); //replace this with the correct formula name

if {@Formula_Name_Column_1} <> '' then

(

shared stringvar array arr;

local numbervar i;

local numbervar cnt;

for i := 1 to ubound(arr) do

(

    if {@Col1} = arr[i] then

        cnt := cnt + 1;

);

cnt;

);

Place this formula beside the Column1 formula and it should display the count.

Repeat for each column.

-Abhilash

former_member279138
Participant
0 Kudos

Thanks but not quite what I'm looking for.

So if I have something like this

Client      Column 1    Column 2      Column 3    Column 4   Column 5    Column  6

1              BBB

2              AAA            BBB

3              BBB            EEE              HHH

4              AAA             DDD             EEE           GGG

5              DDD

6              BBB              CCC

7              AAA              CCC             DDD

8              DDD              FFF

9              AAA               BBB             EEE

I need to count and total each occurrence of "AAA," "BBB," and so on. Like here I have four instances of DDD spread between four columns. How do I count and total it so that I get 4?

Thanks