159
Views
9
Comments
Solved
Expressions on filtered data
Service Studio Version
11.53.26 (Build 61639)

Hello,

I am new to outsystems. I have a application where I sum up the total savings a table:

However, this value is the total savings regardless of what is shown on the table. I would like for the total savings to be based on what is shown in the table. For example, if I filter the table by months, I would like the total savings to be for that month only. Is this possible? Thank you!

2018-10-18 08-34-00
Eric Bulters
 
MVP
Solution

is the SumofProjectSavings  aggregate a separate aggregate as the one used for the table it self? if so, make sure you apply the filters there aswell

2018-10-18 08-34-00
Eric Bulters
 
MVP

Hi Low Ding En, 
How are you filtering? and how are you currently calculating the total?

UserImage.jpg
Low Nico

Hello,

I am filtering based on the search widgets as seen in the image below:

I am using this expression to calculate the total: 

FormatCurrency(SumofProjectSavings.List.Current.SavingsSum, "$", 2, ".", ",")


Thank you for your assistance

2018-10-18 08-34-00
Eric Bulters
 
MVP
Solution

is the SumofProjectSavings  aggregate a separate aggregate as the one used for the table it self? if so, make sure you apply the filters there aswell

2018-10-18 08-34-00
Eric Bulters
 
MVP

By the way, looking at your screenshots. 

The totals do seem to match with what is on the screen.
First screenshot:
5544445 + 3333 = 5547778 
second screenshot:
5544445 + 3333 + 44444 + 66666 + 44444+55555+33333+4444 = 5796664 

UserImage.jpg
Low Nico

Hello Eric,

I duplicated the aggregate used for the table and did the sum functions for the savings. While inputing test values, in the new aggregate, the sum does change accordingly, But when i publish the app, the value does not change. Do i need to add a refresh action or something similar? Thank you

UserImage.jpg
Low Nico

Hello Eric,

I just needed to refresh the new aggregate that I created. Thank you for your suggestion on adding filters to the new aggregate! Much appreciated!

2018-10-18 08-34-00
Eric Bulters
 
MVP

You are most welcome, glad I could help

2024-12-19 07-54-27
Aditya Chinchole

Hi Low,

Yes it is possible, Take the sum of "Savings" attribute like this and use it in the expression of Total savings!

If need it as per months, you can have it like this :

If you need more dynamic filters, use those parameters in filter conditions and then you can get the total savings as per filters!

Hope this helps

Regards

UserImage.jpg
Low Nico

Hello Aditya,

Thank you so much for your assistance, I will try out your suggestion!

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