sumOver problem - levels

Hi! I am using avgOver and sumOver, and I have a problem - sumOver sums all prices across IDs and I want to sum ‘distinct’ values over type as shown in the picture. Is this doable with QS calculations?

Hi @JRoz , Thanks for reaching out. If you are looking to calculate distant value over specific attributes then you can use QS function distinctCountOver.

Alternatively, QS also provide you option to use build-in functions sumOver & avgOver.

Hope this helps!

Hi! I am aware of functions like sumOver etc. but I am unable to achieve result that I had shown on this picture. Column AVG PRICE OVER [OBJECT, DATE] is calculated correctly, its a weighted avg (but it is not relevant for my problem, just to clarify that :slight_smile: ).

I have a problem with sumOver. My calculation looks like this:

sumOver({avg_price_over_object_date},[{DATE}, {TYPE}], PRE_AGG)

And it sums all the avg prices instead of 1,16 + 2,13 = 3,29 - it sums all of them by IDs’ to 24,41.

1 Like

Hello @JRoz

Based on the screenshot, grouping by Date and Type would mean summing every row.

Can you try adding Name to your partition.

1 Like