2 Replies Latest reply on Jun 21, 2016 6:08 AM by Matt Lutton

    How to resolve arument to Sum is already an aggregation

    Manjula Raj

      I want to compare the previous row value and current row value. when it matched i count it as 1. I got this but not able to sum all because i get error already aggregated further can't be aggregate.


      I calculated the filed like:


      Previous chart answer = LOOKUP(ATTR(Answer), -1)


      Up after Up

      IF [Previous chart answer] =  1 AND [Answer Is] = 1 THEN 1 END


      It will show 1 in front of the rows where it should be. But i want to show the SUM of 1's. I've many users and each user has many chart_id for each chart answer is 1 or -1. Now i want calculated show the sum with any rows. How can i do that?


      If i do the WINDOW_SUM( IF [Previous chart answer] =  1 AND [Answer Is] = 1 THEN 1 END) with all the rows it shows the sum values 72954 in all the rows. I need to show only one row with the single column value.


      In screen shot it only showing for user id 1 like this i've user id till 530.


      How to do it?