DataUSA / datausa-tracker

0 stars 0 forks source link

poverty rate measure #203

Closed davelandry closed 5 years ago

davelandry commented 5 years ago

Poverty Rate was one of the ones I had to hard-code a front-end solution for to get it in the map. How difficult would it be to create a new calculated measure which is population in poverty / total population? We definitely need to see this in the map/vizbuilder.

jspeis commented 5 years ago

@hwchen would it be easier to create a calculatedmember or just setup a new cube for this measure?

hwchen commented 5 years ago

So, I have rate calculations already in the template, there just isn't the flag for poverty cube. Give me a sec.

hwchen commented 5 years ago

So, after discussing with @davelandry last week, I totally misunderstood what he meant by poverty rate. Basically, poverty rate is needed regardless of drilldown. It's not a percentage of members within a drilldown dimension.

So here's the calculation:

        <Formula> CASE
            WHEN [Poverty Status].[Poverty Status].Level is [Poverty Status].[Poverty Status].[Poverty Status] THEN 0
            WHEN 1 = 1 THEN ([Poverty Status].[Poverty Status].&amp;[0], [Measures].[Poverty Population]) / [Measures].[Poverty Population]
            END
        </Formula>
hwchen commented 5 years ago

closed by https://github.com/Datawheel/datausa-acs-etl/commit/966a81d4419ffa5eae6cd7bfabb52fcfe465f331

Deployed on mammoth