2 Replies Latest reply on Dec 5, 2013 5:18 PM by Bryan Hallock

    Working with Booleans as Measures

    Bryan Hallock

      My first post, thank you in advance.  I am importing data into Tableau 8 that looks like this:


      Client NumberOffer A?Offer B?Offer Z?

      There are thousands of clients (going down) and 20 product offerings (going to the right).  Nulls are possible.  I perform all of the calculations (i.e. whether an item is offered) in the primary data source and only need Tableau to display the info.  I need the sheet in Tableau to look like this once a single client number is entered into a parameter fill-in box (the lookup works correctly):


      Client NumberOffer A?Offer B?Offer Z?


      My questions are:

      1) What data type should my primary data source (table) be in order to work as a measure in Tableau?  Only numbers?

      2) How do I work with this in Tableau to display as "Yes"/"No"?


      If I make it a char and have "Yes"/"No", "True"/"False", or even 1's and 0's, it treats it as a dimension.  I am limited to 6 dimensions per row in Tableau, so I need them as measures.  If I make it a tinyint with 1's and 0's, it comes in as a measure, but I can't transform the 1's and 0's into "Yes"/"No" values.  You can't alias a number (default properties) as far as I can tell. 


      If I create a calculated field (IIF(A>0,'Yes','No','n/a')), it will correctly transform the 1's and 0's, but it throws it back up to dimensions again.  Back to square one.  Note that example calculated field would have to be repeated 20 times (one per product).  What I would like to work is: IIF([Measure Value]>0,'Yes','No','n/a'), but it does not.


      Also, due to dashboard limitations, I would rather the table stretch across left to right (like above), not up and down (like: Client Number, Product ID (A,B,C,etc.), Offer? (Y/N)).  Thanks.