How to Get value of SUM,COUNT, and posting it in the different entity

How to Get value of SUM,COUNT, and posting it in the different entity

  

Assalamu'alaikum.

Hi, i'm Fahmi.

I want to show the value of aggregate function such as SUM, COUNT. But i want to show the value in the different table.

so, that's my table. Please help me.

Thanks

Waleikum Assalam Fahimi,

Can you please explain a bit more in detail.

As per my understanding, you need sum and count for posting table.

Questions: 

1. Sum of what?

2. Do you want to update table values with sum and count form posting table?

approach 1 : you can use the aggregate for calculating count and sum and update the same values in the Entity. this can be done whenever there is an insert or update on the posting entity.

approach 2: you can create a timer which will run periodically and update the counts and sum.


Thanks,

Waseema.


Hi fahmi,

You can get help from below link.

https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Data/Query_Data/Aggregate_a_Column_into_a_Single_Value

If you need any specific help, please provide more details.

Shashank...

fahmi fachrurozi wrote:

Assalamu'alaikum.

Hi, i'm Fahmi.

I want to show the value of aggregate function such as SUM, COUNT. But i want to show the value in the different table.

so, that's my table. Please help me.

Thanks

hi Fahmi,

Say you want to show the sum of entity A, and then put it in the column of aggregate B.

The steps to do:

1. Create a FUNCTION that sum the entity A and return that sum value.

2. In aggregate B, create new Attribute that calls the FUNCTION

regards,

bb 


Hi fahmi,

Before providing more details about what you are trying to achieve let me give a suggestion on your data model. I would say the Profile part should be more like this:

Profile should be an extension of the entity User that already has username, password and name (to use built in features to better manage logins and users in general)

Picture is kept in an extension of the entity Profile (for better performance).

Cheers,

José

Hi,


not sure if you already solved it already.

but the question is a bit vague.


get sum, count is a matter of using aggregates wisely (or when that does not work useage of advanced queries)

This should be covered more or less in the online training.


next, what do you mean by "posting" it into another entity?



J. wrote:

Hi,


not sure if you already solved it already.

but the question is a bit vague.


get sum, count is a matter of using aggregates wisely (or when that does not work useage of advanced queries)

This should be covered more or less in the online training.


next, what do you mean by "posting" it into another entity?



i mean like this. So, i want the aggregation value e.g SUM shown in the JumlahComm column. So, what steps do i have to do ?

Hi Fahmi,

I would still recommend you to check the link to get basic understanding.

https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Data/Query_Data/Calculate_Values_from_Grouped_Data

To use an Aggregate, you need to use Group By on any column and add another attribute for Count or Sum.

  1. In the attribute with identical data, use the  menu and select Group by <attribute>;
  2. In the attribute to calculate, use the  menu and select an aggregate function, e.g. Count.


In your question it is still not clear which column has to be grouped to see SUM or COUNT.


Shashank...