257
Views
5
Comments
Solved
Summing up a column
Service Studio Version
11.53.26 (Build 61639)

Hello,

I am new to outsystems and I want to sum up the savings column in my table/aggregate.

I tried to go into the aggregate used for this table and performing the sum function

But after doing that, it causes errors in every element in my table 

May I know what I am doing wrong? Thank you

UserImage.jpg
vikas sharma
Champion
Solution

Hi,

Basically when we do Group By or any other calculated attribute then only these attributes get available in the output of the aggregate. Possible solutions for this :

1. you should apply group by on other columns as well which you want in output. 

2. Calculate total yourself by some logic in the screen, like in the onAfterFetch of aggregate.

3. Fire a new SQL query, it will return only one result that is sum of all amounts.

regards


UserImage.jpg
Low Nico

Hello Vikas,

Thank you so much for your solutions, I ended up creating a new aggregate purely for the sum function which was what you suggested. Thank you so much for your assistance!

UserImage.jpg
Wasim Khan S

Hi Low Ding En,

If you sum up the columns in aggregate. You will get only that calculated attribute as output parameter from that aggregate.

Pls refer to the screenshot of aggregate output when you do sum.

UserImage.jpg
Low Nico

Hello Wasim,

Thank you for this clarification, I did not know this and it was helpful in helping me figure out the solution. Thank you for your assistance!

UserImage.jpg
vikas sharma
Champion
Solution

Hi,

Basically when we do Group By or any other calculated attribute then only these attributes get available in the output of the aggregate. Possible solutions for this :

1. you should apply group by on other columns as well which you want in output. 

2. Calculate total yourself by some logic in the screen, like in the onAfterFetch of aggregate.

3. Fire a new SQL query, it will return only one result that is sum of all amounts.

regards


UserImage.jpg
Low Nico

Hello Vikas,

Thank you so much for your solutions, I ended up creating a new aggregate purely for the sum function which was what you suggested. Thank you so much for your assistance!

UserImage.jpg
Wasim Khan S

Hi Low Ding En,

 Mark the answer as solution if your issues resolved.


Thanks,

Wasimkhan

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.