WINDOW RECIPE - SUM

Solved!
Marina_G
Level 1
WINDOW RECIPE - SUM

Hello,
I'm working with the window recipe.
I have one simple dataset and i want compute sum and avg for each group.
In the window definition I set up partitioning by variable "type", and in the window aggregations I choose sum and avg for variable "value". I expect dataiku computed sum and avg for each "type" group (i.e if the rows have the same "type" i expect the same sum), instead it recalculates sum and avg for each row within the group. Can anybody help me? Here's Dataiku output:

 
 
TYPEVALUEVALUE_avgVALUE_sum
A222
A32,55
B333
B548
B23,33333333310
C555

 

0 Kudos
1 Solution
fchataigner2
Dataiker

Hi,

the default for windows it to compute running sums inside each partition. If you want the overall sum and average for each partition, you need to enforce an unbounded window frame: activate the window frame, and make sure neither limit preceding nor limit following are checked

View solution in original post

0 Kudos
2 Replies
fchataigner2
Dataiker

Hi,

the default for windows it to compute running sums inside each partition. If you want the overall sum and average for each partition, you need to enforce an unbounded window frame: activate the window frame, and make sure neither limit preceding nor limit following are checked

0 Kudos
Marina_G
Level 1
Author

Thank you, it works!!!

0 Kudos