# SUMOVER is not working

**URL:** <https://community.amazonquick.com/t/sumover-is-not-working/19560>\
**Category:** Q&A\
**Tags:** Business-Intelligence-Engineer, quick-sight\
**Created:** [October 13, 2023, 11:07am UTC](https://community.amazonquick.com/t/sumover-is-not-working/19560 "2023-10-13T11:07:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhilash\_Pandey](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@Abhilash\_Pandey](https://community.amazonquick.com/u/Abhilash_Pandey)\
**Post date:** [October 13, 2023, 11:07am UTC](https://community.amazonquick.com/t/sumover-is-not-working/19560/1 "2023-10-13T11:07:24Z")

</div>

Hi,

I want to calculate the sum of Duration for a day for unique combination of EventDate (not date time), Machine and User ID.  
I have build a calculated field using sumover : sumOver({Session Duration (Hours)},[{UserID[Logout]},{MachineName[Logout]},{EventDate[Logout]}],PRE\_AGG ).

But this not giving me the right output.

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/a/af22a91bc43ce2876c5aaadc3a930e6de63484e2.png)

I want the column encircled in blue (column name : Session Duration Hours) to be used to give output like in yellow ( column name : Exp : Day’s Total Session Duration (hours) )  
But using sumover giving the column encircled in RED.

How to write a calculated field for this using SUMOVER or any other function that builds a column.

#how-to #sumOver #calculations

---

<div class="post-metadata">

**Author:** ![ErikG](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/erikg/32/14524_2.png) [@ErikG](https://community.amazonquick.com/u/ErikG)\
**Post date:** [October 13, 2023, 11:40am UTC](https://community.amazonquick.com/t/sumover-is-not-working/19560/2 "2023-10-13T11:40:37Z")

</div>

Hi @Abhilash_Pandey ,

if you want the yellow one. wouldnt that be a runningSum?

 ![grafik](https://d1wl4jav5dp96l.cloudfront.net/original/2X/c/ce554947aeecadb0d987e485e5e91c954c6e9ce0.png)

BG

---

<div class="post-metadata">

**Author:** ![Abhilash\_Pandey](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@Abhilash\_Pandey](https://community.amazonquick.com/u/Abhilash_Pandey)\
**Post date:** [October 13, 2023, 12:16pm UTC](https://community.amazonquick.com/t/sumover-is-not-working/19560/3 "2023-10-13T12:16:26Z")

</div>

Hi @ErikG

No I don’t want a running sum. As I am using the this calculated column further to calculate efficiency score. For this I want my Duration to be fixed at the userID, machine and eventDate field.

---

<div class="post-metadata">

**Author:** ![ErikG](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/erikg/32/14524_2.png) [@ErikG](https://community.amazonquick.com/u/ErikG)\
**Post date:** [October 13, 2023, 12:35pm UTC](https://community.amazonquick.com/t/sumover-is-not-working/19560/4 "2023-10-13T12:35:35Z")

</div>

Sorry. Had a typo in my dataset, caused some trouble.  
But SumOver should work, in general.

```auto
sumOver(Duration,[User,Maschine,Date],PRE_AGG )

```

![grafik](https://d1wl4jav5dp96l.cloudfront.net/original/2X/1/19821502a758af09f2359ccc30c70f74ab75faa4.png)

---

<div class="post-metadata">

**Author:** ![apjvinod](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@apjvinod](https://community.amazonquick.com/u/apjvinod)\
**Post date:** [October 19, 2023, 1:33pm UTC](https://community.amazonquick.com/t/sumover-is-not-working/19560/5 "2023-10-19T13:33:12Z")

</div>

Hi @Abhilash_Pandey

Did @ErikG 's solution work for you? I am marking the reply as “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the Quick Sight CommunityQ&A Forum!
