How to present the total sum of a Count Aggregate Attribute?

Dear All,

I am trying to display on my Dashboard screen the total sum of a Count Aggregate Attribute trough an expression. As you can see::

The aggregate is as follows:


The above aggregate was used to construct the Donut Chart, and I woul like to present after this chart the total count  wich is the sum of each count for each label.

Can you help me?

Thank you,


Luis

Hi,

Either add another aggregate to get the total count. If you don't want the overhead of an additional aggregate, you code an OnAfterFetch event handler where you loop loop over the  aggregate rows and sum up the count of each aggregate row into local screen variable.

Regards,

Daniel

Thank you Daniel,

as you may see on the diagram, I have a Switch Widget that OnChange call the following Client Action (SwitchOnChange):

The Client Variable SujmOfCount is set to zero and in the ForEach cycle 

SumOfCount=SumOfCount+GetToDosWithPriorities.List.Current.Count

The result is that SumOfCount is Zero.

Need your help, I dont mean to use another agreggate.

Thank you,

Luis

Hi,

To ge the sum your action is ok. I only would think that you would call this action as the OnAfterFetch event handler for the GetToDosWithPriorities aggregate. The OnAfterFetch event is automatically triggered when the fetching of data is completed, and is the perfect moment to do some processing on the fetched data.

Why you want to do this calculating using a switch widget?

Regards,

Daniel

Hi,

because I have the following filter on the aggregate:

SyntaxEditor Code Snippet

If (SwitchGetToDosByTime, Month (LocalToDo.DueDate) = Month (CurrDate()), Year (LocalToDo.DueDate) = Year (CurrDate()))

The SwitchGetToDosByTime cliente variable is boolean and associated with the switch.

Therefore I will have the count of ToDos in the current year and the current month. This works fine. Howver I would like to see the all count results not depending on the priority.

Regards,


Luis