Help

Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here

Using a function to create precents

70 1
cancel
Showing results for 
Search instead for 
Did you mean: 

Airtable support!

Thank you in advance for helping me with this issue. I would like to use Airtable to track web page metrics. Each week, our company publishes web articles. The first column is the date the article was published, the second column is the name of the article, the third column is the page views and we would like the fourth to show the percent each page article was viewed. An example is below. 

maires_0-1674066829255.png

The percent column should be as follows: 

2023-01-03

26.67%
33.33%
40.00%

2023-01-10

16.67%
33.33%
50.00%

Would someone be kind enough to help me create the formula needed for this outcome? 

Thank you!! 

1 Reply 1

Thank you for the screen shot and the explanation of the desired output.

You cannot do this with only a formula field. The total daily views that you see in the summary bar are not available to formula functions. You need a linked [Dates] table and a system of back-and-forth rollups.

1. Create a [Dates] table with one record for each day.

2. Link each record in your current table to the correct date. 

3. In the [Dates] table, create a rollup field {Daily Pageviews} that totals the {Pageviews} field. Use the rollup formula SUM(values). This field should have the same total that currently appears in the summary bar.

4. In the your original table, create another rollup field that shows the {Daily Pageviews}. You can also use the formula SUM(values).

5. In your original table, you can now have a formula field that divides {Pageviews} / {Daily Pageviews}. Then set the formatting options for the formula field to display as a percent.