# Better documentation for calculated fields?

We are trying to leverage the calculated fields through the user interface and would like to get a list of formats, optional calculations, formula’s etc.  While simple calculated fields are pretty easy, the next tier of complexity requires a much better understanding of what is possible.

For instance if I were to track the daily COVID-19 data here https://covidtracking.com/api/v1/states/daily.json.
How would I calculate the following:

• a day over day growth of positive cases?
• Growth rate over the last 3 days or 7 days shown each day?
• The number of days it takes to double the positive cases shown each day so you could see a trend over time?

I’m hoping there is a document that lays out all of the options and how to use them?

Public
May 12, 2020

Hi Dan,

Thank you for posting your question.

To start with, please see the following documentation page for a detailed overview of all the features available under calculated values: https://www.flexmonster.com/doc/calculated-values
We also think it might be helpful to check out the full list of supported aggregation functions in our technical specifications: https://www.flexmonster.com/technical-specifications/

1. The day to day growth can be visualized using the built-in `difference` aggregation. We’ve built a quick sample to illustrate this function in action: https://jsfiddle.net/flexmonster/kuosLyzf/
2. The growth rate can similarly be calculated with the `% difference` aggregation provided by Flexmonster. It is important to understand that the `difference` and `% difference` aggregations are calculated based on neighboring hierarchy members. Therefore, to calculate the growth rate over a specific period of time, you need to filter the date field in a way that the start and end dates of the period are displayed. Please see the following sample illustrating this approach: https://jsfiddle.net/flexmonster/49gk8m7t/
3. Speaking of your 3rd question, the right formula for this use case (doubling time = ln(2) / ln(1 + growth rate)) requires using the logarithm function, which is currently not supported in Flexmonster calculated values. Could you please specify how critical this is for you so that we can understand the whole situation better?

Alternatively, you can create your own aggregation functions when building a custom data source API implementation, although this option also requires some work on your side.

Best regards,
Mykhailo

Public
May 18, 2020

Hi Dan,

Hope you’re doing well!

We are just checking in to make sure you’ve received our response to this question. Do you think you could give us an estimate of how important it is for you to have the ability to use logarithms in formulas?

Thank you in advance and looking forward to hearing from you.

Regards,
Mykhailo

Public
May 25, 2020

Hi Dan,

How are you?

We were wondering if you’ve received our last reply. Could you please give us any insights on our previous inquiry?

Thank you!

Regards,
Mykhailo