Post

2 followers Follow
0
Avatar

If Then Relationship Category with Count

I have an app A and B connected via a relationship.

In app B I have a category field with 3 options (Active, Dead, Converted)

How can I create a calculation in app A where I can get a total count of all B items connected to A only if the Category field equals "Active"?

Thanks in advance.

Faisal Velani

Please sign in to leave a comment.

2 comments

0
Avatar

Hello Faisal,

var i,
cat = @all of category field name in App B,
sum = 0;
for(i = 0; i < cat.length; i++){
     if(cat[i] == "Active"){
        sum += 1;
    }
};
sum

Rainer

Rainer Grabowski 0 votes
Comment actions Permalink