7 Replies Latest reply: Sep 14, 2012 5:26 PM by helsinkijaui RSS

    aggregate counts from different if conditions

      i have a complex set of conditions depending on values of the Fact table, each of which might result in a different figure (e.g. 3, 4 and 5 for each of the following).
      =if(source1='1',(count( {$< STATUS = {'A', 'B'}>} DISTINCT ITEM_ID)),
      //Next line for counting the items with Status = C and any Resolution except F or G.
       if(source='1',(count( {$< STATUS = {'C'},RESOLUTION= {"*"} -{'F', 'G'}>} DISTINCT ITEM_ID)),
        if(source='2',(count( {$< STATUS = {'A', 'D'}>} DISTINCT NS_BUG_ID)))))
      I'm looking for the aggregate of those three (or two, or one) resulting figures, or zero if none of the conditions are met.
      Having sum(aggr(  in front of everything above doesn't seem to work. I guess i'm using something wrongly...
      Any ideas are welcome.