2 Replies Latest reply on Jul 26, 2017 1:27 PM by Scott Carman

    Boolean Logic

    Scott Carman



      Ok so I am a really new guy to Tableau and having a hard time with everything.  Here is what I am trying to do:


      I have an Access database (db) that I building to manage a wireless program.  The program has a table of monthly costs, which houses the monthly records for a device.  Some of these costs are "flagged" as nonUsage when a device has not been used in a predetermined amount of time.


      I cannot put data on here because of privacy but here is kind of how the table looks:

      Org B

      Device IDOrganizationMonth of ServiceCostNon Usage
      Device 123Org AJan 201740.00No
      Device 456Org BJan 201740.00Yes
      Device 789Org AJan 201740.00No
      Device 123Feb 201740.00No
      Device 456Org AFeb 201740.00Yes
      Device 789Org BFeb 201740.00Yes


      So I have brought this information in to my Tableau view.  I am building  a few views from here:


      One is a view of the total cost of devices for a month per Org.  Another view is the total cost of non Usage for a month per Org.


      Here's the part where I am stuck - I want to build a view that shows the total cost of non Usage under the total cost for the month.  I see two line graphs, one line for non usage under the line for total cost spent.


      I have tried building a calculated field such as SUM(Total Cost) - Sum(nonUsage Total Cost) and that doesn't work.  I have tried summing the nonUsage Total Cost where the Non Usage equal Yes and that doesn't work.  Tableau keeps giving me an related to the Boolean field.


      Any help on this or guidance on creating a calculated field would be helpful.


      Thanks in advance,



        • 1. Re: Boolean Logic
          Alex Braun

          Look at the Non - Usage formula in here, basically I am just taking the records that are marked as non-usage (I am assuming that 'yes' means they aren't using it).


          I added both the sum(cost) and the sum(non-usage) to the rows shelf and made them a dual axis graph. Make sure you sync the axis as well.

          • 2. Re: Boolean Logic
            Scott Carman



            Thank you!  This worked!  I appreciate you taking the time to show me a very simple answer to my question.  Along the way you have made me more familiar with the syntax for creating a calculated field.  Thanks again!