Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: rboccuzziKursat Taskin, nice job with the R node; I'm glad you found a way.
A couple of comments, please take these as coaching and encouragement, as I mean no criticism.
First, for the summerize node, I looked at your code in the library, and it is pretty good. I'm not sure you know, but there is a variable execCount which is set for each iteration of the BRAINscript. In your first Agg, you don't need to emit 1 as KayitNo; rather on the second Agg (or even a filter, really, since you aren't agging at all), you could "emit execCount as RecNo_URN" to get that unique numbering per row. Otherwise, it looks pretty good.
I noticed for your solution, you need to list the numeric fields you wish to aggregate. I think currently, in order to do it without listing the fields, you would need to use some language that can do the type inspection and only aggregate the numeric fields (and modify it's metadata dynamically). This can't currently be done easily in BRAINscript, it should be possible in R (I don't know R enough to propose a specific solution), and certainly you could do it in Python and Java nodes if you wish. Given your current solution, I also wanted to show you one that might be good enough for you as well, since it also does need the fields listed out.
Take an "Agg Ex" node, and place the SumBy fields in the GroupBy parameter. Then modify the script parameter, add a line like this:
emit value = groupSum('value')
for each numeric field you wish to aggregate.
It isn't as simple as just listing the fields as you can do in your node, but is fairly straightforward. I just wanted to offer it up as another alternative, and help show you how things could be done in BRAINscript.
Cheers
Rich