Sum over attributes per cell


#1

Dear SciDB Gods,

I have an array that has the following schema :

counts
<
  A:int64 NULL DEFAULT null, 
  B:int64 NULL DEFAULT null, 
  C:int64 NULL DEFAULT null, 
  D:int64 NULL DEFAULT null, 
  E:int64 NULL DEFAULT null, 
  F:int64 NULL DEFAULT null
> 
[id=1:25,1,0, p=1:25000,100,0]

As I understand sum() is over dimensions for same, single attribute. My need is to sum four out of six attributes per cell. So, For each cell, the sum of A + B + C + D only.

Is there a way to sum() over attributes per cell?

Thanks.


#2

Why not simply add 'em up?

apply ( counts, result, A + B + C + D )

or

SELECT A + B + C + D AS result 
  FROM counts;

Or am I missing something?


#3

Thanks! I believe I was thinking something way too complicated.


#4

That’s something I think whenever I read my old e-mails.