6 Replies Latest reply on Feb 18, 2015 7:04 AM by Kevin Marsh

# Logical ratio?

I have a bunch of data for leads from a CRM. I've created a calculated field called "Sold?" that is basically [Number of Orders] > 0. This is working fine, and I can group by that field to show the number True and False, and total.

What I'd like to do is graph the percentage of leads that have Sold? = true, but can't quite figure out how to make it work.

Thanks in advance for any tips!

• ###### 1. Re: Logical ratio?

Can you post a sample TWBX?  You should be able to mock up this scenario fairly quickly using the Superstore Sales data set that ships with Tableau.  Cheers!

• ###### 2. Re: Logical ratio?

Sure!

I didn't have quite the same kind of data there, so I made up an example.

I created a Calculated field called "Even Customer ID?". I then added a visualization that counts the number of True and False values. What I'd really like is the % of "True" values: e.g., % of orders that have even customer IDs. (in my real-world case the question is more like "% of leads that sold")

• ###### 3. Re: Logical ratio?

Is this what you're after?  If so, you can right click your SUM(Number of Records) pill, choose Quick Table Calculation >> "Percent of Total", and set the Compute Using on this table calculation to use the [Even Customer ID?] dimension.

Version 8.2 TWBX attached with this applied.

• ###### 4. Re: Logical ratio?

Hi Kevin,

For the calculation of sold(true) percentage , you have to create a new calculated field where you have to formulate something like

count([sold(true):previous cal field]) / count(Total no of records)

• ###### 5. Re: Logical ratio?

Thanks, this is about how far I got... but since its a table calculation it wouldn't "survive" if I removed that dimension. I wanted to graph the percentages over time of just a particular value (e.g., Trues). This was showing 100%s.

• ###### 6. Re: Logical ratio?

Not sure about the "sold(true):previous" syntax there, but I think I got it with a calculation like:

IIF([Sold?] == TRUE, 1, 0)/[Number of Records]

Seems to work! Thanks!