# Column sum in SPSS (with filter and grouped by date)?

device      date     act power 1     react power 2
-------------------------------------------------
M1         05-02            2              3
M2         05-02            4              2
M3         05-02            3              4
M1         06-02            1              2
M2         07-02            3              4
-------        -------
need sum       need sum



Say that I only need the sum of M1 and M2 from that table. How could I add a variable that contains the sum of power group by date and device?

I don't know if it is desired to have something like this? Or how can I use descriptive statistics to filter away the other devices just to have M1 and M2 only.

device      date     SUM (actpower1)     SUM(reactpower2)
-------------------------------------------------
M1+M2      05-02            6              5

$$$$


Normally such operations are done in Excel (click into an empty cell and type =Sum( select the column of which you want to calculate the cumulative sum and then close the bracket ). Finally, hit enter). Note that the sum is only a global metric. It will not be a local measure for each observation that you have.
If you want to get these sums in SPSS you can use the descriptive statistics or you can also use the following syntax CREATE CUMMULATIVESUM=CSUM(OLDVAR)`. This will generate the cumulative sum for your observations. The entry for your last observations will be the sum of all observations.