calculate the # of related items with specific status

Comments

2 comments

  • Rainer Grabowski

    Hi Fabien,

    I think you find many examples in this forum for filtering/counting items by if-conditions. 
    In general this is the way to do it:

    var status = @All of your status field name in related app;
    var count = 0;
    for(var i = 0; i < status.length; i++){
         if(status[i] == "1"){
            count += 1;
         }
    };
    count

    If you want to check for OR conditons (status == "1" OR status == "2" etc):

    var status = @All of your status field name in related app;
    var count = 0;
    for(var i = 0; i < status.length; i++){
         if(status[i] == "1" || status == "2" || status == "3"){
            count += 1;
         }
    };
    count

    Rainer
    0
    Comment actions Permalink
  • fabien cohen

    thx

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk