Tableau – Creating Calculated Fields

I have a set of data that shows number of tenants created on a server. My goal is to represent the same on a bar chart. Each row represents a tenant in the table. In order to get the total number of tenants on a server, create a new Calculated Field and name it “Number of Records” and set the value to

1

Now when you drag this measure to the column/row in Tableau, sum will show the number of tenant records on the server.

Next thing I wanted to do was to show the count of paid (non-trial) tenants on the server. The criteria for a tenant to be a paid online order is that the purchase_date in the raw will be not NULL. For this, I calculated another Calculated Field called “Is Online Order” as follows:

IF ISNULL([Purchase Date]) THEN 0 ELSE 1 END

Now, I created another Calculated Field “Total Online Orders” that would give me the sum of Online Orders as follows:

sum([Is Online Order])

Now, I can drag the “Total Online Orders” field to the Color mark and it would darken the bars that have more number of online orders and vice versa. The Tooltip on the bars will also show “Total Online Orders” in that region.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s