Query Logic for aggregating data
I have the following data:
variable1 variable2 varialble3
1 . 0
2 . 1
3 . 0
4 0
5 . 1
I would like to sum variable1 based on the value of variable2. All the variable1 items with a 0 in var2 should be summed including with the var1 that has a var2 of 1. The result is stored in var 3. So the final table should look like:
variable1 variable2 variable3
1 . 0 0
2 . 1 3
3 . 0 0
4 0 0
5 . 1 12
What kind of log query command could I use to do this? Thanks!
Please sign in to leave a comment.
Comments
0 comments