This website uses cookies. By clicking OK, you consent to the use of cookies. Read our cookie policy.

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Solved!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

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:

TYPE | VALUE | VALUE_avg | VALUE_sum |

A | 2 | 2 | 2 |

A | 3 | 2,5 | 5 |

B | 3 | 3 | 3 |

B | 5 | 4 | 8 |

B | 2 | 3,333333333 | 10 |

C | 5 | 5 | 5 |

1 Solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

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

Solutions shown first - Read whole discussion

2 Replies

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Thank you, it works!!!