Skip to main content
Topic: Record Count - Calculation (Read 1507 times) previous topic - next topic

Record Count - Calculation

Hello;

I have a question about Record Count or Circular Record Progress Element.
I create a simple table for actions.
It includes two fields like "action_description" and "Status".
Status mean; related action had been "completed" or still "open".

In my homepage I already add record count element to see completion level of actions.
I am able to count records with small sql query and filter which are completed.

But I want to see results in percentage.
In attached file i saw project progress level or any other alternatives.

Is it possible to add such kind of percentage information at dashboard?


or is it possible to make math calculations for record count element?
for example;

(Record Count equals to "Completed") / (Total Record Count) * 100





Re: Record Count - Calculation

Reply #1
@pierremataias‍ you will have to do your calculations using SQL. you have to make sure you have set ProgressBar to True and ProgressMaxValue to 100 or the max value you want to use. The below code has not been tested but should work. Please replace the table name and the status field with yours.
Code: [Select]
SELECT (((SELECT COUNT(*) FROM table WHERE Status = 'completed') / (SELECT COUNT(*) FROM table)) * 100) AS num

 

Re: Record Count - Calculation

Reply #2
Thanks @willvin

Everything works fine.  8)