1
votes

I'm exploring Consumer Expenditure microdata (individual level data) from BLS and I'm looking to create a new field for investable assets by adding a number of different fields and bucketing respondents into $250K+ and <$250K. I'm using Tableau Public.

My formula is below. Various fields are things like total value of stock holdings, retirement accounts, checking & saving accounts, etc.

If [Irax] + [Irabx] + [Liquidb] + [Liquidbx] + [Othastx] + [Othastbx] + [Stockbx] + [Stockx] >= 250000 THEN "$250K+"
    ELSEIF [Irax] + [Irabx] + [Liquidb] + [Liquidbx] + [Othastx] + [Othastbx] + [Stockbx] + [Stockx] > 250000 THEN "<$250K"
END

The calculation is valid, however the result is not accurate. The formula buckets everyone into the >$250K bucket, even though there are clearly individuals that have over that amount.

What is happening here?

1
If [Irax] + [Irabx] + [Liquidb] + [Liquidbx] + [Othastx] + [Othastbx] + [Stockbx] + [Stockx] >= 250000 THEN "$250K+" ELSEIF [Irax] + [Irabx] + [Liquidb] + [Liquidbx] + [Othastx] + [Othastbx] + [Stockbx] + [Stockx] > 250000 THEN "<$250K" END - CLPatterson

1 Answers

0
votes

Define a field called investable assets =

[Irax] + [Irabx] + [Liquidb] + [Liquidbx] + [Othastx] + [Othastbx] + [Stockbx] + [Stockx]

Then define a numeric parameter called [investment threshold] defaulting to 250000

Then finally a calculated field called rich guy =

SUM([investable assets]) > [investment threshold]

Now you can use [rich guy] as desired, and tweak your parameter interactively.

There are other variations, you could use LOD calcs or sets instead. You can define an alias for [rich guy] to display "Loaded and Broke" instead of "True and False". But this is a typical approach for spotlighting.

BTW, the only thing that is especially different than your approach is the use of the function SUM()