10 Replies Latest reply: Mar 21, 2013 6:34 AM by Michael Solomovich RSS

    Newbie need help on expressions with count and if PLEASE!!

      I been trying using the following expression to get the exactly amount of machines per year, but instead of that i just get the total of all years:

      First I try this:

       

       

      The values per year are: 2013=349, 2012=349, 2011=300, 2010=348.

      Count

      (if(DATE_MAQUINAS='2013',[DATE_MAQUINAS],

      if(DATE_MAQUINAS='2012',[DATE_MAQUINAS],

      if(DATE_MAQUINAS='2011',[DATE_MAQUINAS],

      if(DATE_MAQUINAS='2010',[DATE_MAQUINAS])))))

       

      The return is the total

      Then I try:

       

      Count

      (if([DATE_MAQUINAS]=2013,[DATE_MAQUINAS]))

       

      The result for the first two years it's correct but when I select on the List Box (Year) 2011 or 2010 shows wrong information.

      The funny thing is that if put 2010 instead of 2013 the value it's right for that year but wrong for the other years when I select them on the List Box (Year), same for any year changed on the expression.

       

      Count

      (if([DATE_MAQUINAS]=2010,[DATE_MAQUINAS]))

       

      Other thing that I need is to remove from the count some machines that are in colum ID_MACHINE, the ones that ends with Letter "A" and I don't have any idea how to do that.

       

      I hope someone can help me with this.

       

      THANKS