Calculate percentage for all features

170
1
08-01-2021 11:54 PM
Labels (1)
OfraAi
by
New Contributor II

I have data about Covid 19 per city, per day.

Some of the measures are calculation of sick percentage of all population, percent of positive tests and so on.

For example: pctSick = sick / population

I need to calculate these measures in other levels then cities, like region and all country.

The right calculation should be sum(sick) / sum(population), while the data is filtered by the city/region/country.

The only option I see in dashboard is calculating avg(pctSick) which is not correct.

How can I define the right calculation, and use is in indicators and graphs?

Thanks in advance

Ofra

0 Kudos
1 Reply
OfraAi
by
New Contributor II

Hello,

I've made some progress.

In Indicators, I've found that I can define in Data tab: 'value' as sum over sick, and 'reference' as sum over population.

In Indicator tab: Advanced formatting, I enabled the expressions.

There are already several definition of calculations, and one of them is 'ratio'.

I only had to use this variable as the middleText and it works very good.

When I filter the dashboard, these values a also filtered (after defining them in the action of the category selection off course).

Now I need this calculation in a chart...

Any idea how to define the arcade expression the will do the summarize and division, and still have the city to filter by?

Any help would be very appreciated.

Ofra

 

0 Kudos