2 Replies Latest reply on May 18, 2016 2:11 PM by Derrick Austin

    Cannot mix aggregate and non aggregate.

    angelo martinez

      Please help me. I only want to show the active users and inactive users. The field Number of Real Wager is the money and the field TotalDias is the difference between last conection and today. If the user have more and equal 15 days is Inactive and if the user have less 15 days is Active. Else is Never use.

      This is the code that I am using in this problem.

       

      -----------------------------------------------------------------------------------------

      IF [Number Of Real Wager] > 0 AND

      [TotalDias] < 15 THEN 'Activo'

       

      ELSEIF [Number Of Real Wager] > 0 AND

      [TotalDias] >= 15 THEN 'Inactivo'

       

      ELSE

       

      'Nunca uso'

       

      END

      -------------------------------------------------------------------------------------------@

        • 1. Re: Cannot mix aggregate and non aggregate.
          Joe Oppelt

          One of those fields is an aggregate.  Probably [TotalDias].

           

          If so, then do this:

           

          IF attr([Number Of Real Wager]) > 0 AND

          [TotalDias] < 15 THEN 'Activo'

           

          ELSEIF attr([Number Of Real Wager]) > 0 AND

          [TotalDias] >= 15 THEN 'Inactivo'

           

          ELSE

           

          'Nunca uso'

           

          END

           

           

           

          If [Number of Real Wager] is the aggregate, then enclose [TotalDias] in ATTR() instead.

          • 2. Re: Cannot mix aggregate and non aggregate.
            Derrick Austin

            Hello Angelo,

             

            It's hard to tell from the formula, but it seems that one of the fields is aggregated and the other is not.

            It is possible that wrapping ATTR() around the one that is not would fix the issue.

             

            Another thought might be LoD calculations, for example:

            IF [Number Of Real Wager] > 0 AND

            {FIXED [Customer] : [TotalDias]} < 15 THEN 'Activo'

            ...

             

            Hope this helps!