6 Replies Latest reply on Oct 1, 2013 1:36 AM by Jim Wahl

    Using a boolean field from a blended data source

    Donna Coles

      I have a view that blends 2 data sources.  All fields from my primary data source I can use in my view fine, but I can't seem to use boolean fields from my secondary data source - they're greyed out.

       

      I can get round it by creating a calculated field in the secondary data source based on the boolean that returns a string eg (IF [my_boolean field] THEN 'Yes' ELSE 'No' END).

       

      Has anyone else noticed this? Is it a 'bug' or 'by design'?

       

      Thanks

        • 1. Re: Using a boolean field from a blended data source
          Matt Lutton

          I believe this is by design, since the original calculation was created pre-blending and it cannot recognize the blend.  I could be wrong, though as I don't have a whole lot of experience with this.

          • 2. Re: Using a boolean field from a blended data source
            Donna Coles

            Hi Matthew - I'm not quite sure what you mean about the pre-blend - its probably just my ignorance to how blending works.  I see it being similar behaviour to a 'left outer join' in SQL, so assume I can to every field from my primary source supplemented by fields from my secondary source if a match is found via the blend condition....  Just to clarify, this is the scenario :

             

            I have my primary data source with dimensions customer and order no and a secondary data source with customer, postcode and an 'is vat exempt' boolean field.  The data is blended on customer.  I want to do a basic data listing showing customer, order no, postcode & vat exempt.  I can get all the fields into the view apart from the 'is vat exempt'.

            • 3. Re: Using a boolean field from a blended data source
              Matt Lutton

              I just meant that I assumed your Boolean field was created based on fields in the primary source, before the blend was setup.  Anyway, I don't know much else--but I set up a blend myself and could not use a Boolean from the secondary source either.  I don't know the precise reasoning.

              • 4. Re: Using a boolean field from a blended data source
                Ville Tyrväinen

                Hi,

                 

                Can you post a workbook, so that I can test that one?

                • 5. Re: Using a boolean field from a blended data source
                  Donna Coles

                  I've tried several times to post a very basic workbook, but something's going a bit strange - have tried in IE10 and chrome via the advanced editor option & adding attachment, but nothing seems to appear on this thread.  Sorry.  Its very easy to replicate though.


                  • 6. Re: Using a boolean field from a blended data source
                    Jim Wahl

                    Hi Donna,

                     

                    I believe the issue is that data from secondary data sources must be aggregated.

                     

                    Boolean fields cannot be aggregated (in Tableau, anyway), but your text version of the field can--Tableau by default uses the ATTR() function. If all of the values are True/Yes or False/No, ATTR() will generate Yes or No. If there are a mix of values, ATTR() will return '*'.  You could force a mix to False by using MIN().

                     

                    You can see this behavior more clearly by creating a new calculated field in the primary data source. In the Calculated Field dialog box, select the secondary data source and double click on your Boolean field. Sine it's coming from a secondary source, Tableau will add it with the aggregate function ATTR() and you'll get an error that ATTR() is not applicable to Boolean fields. Replace the Boolean field with your Yes/No text field and again you'll see it's added with the ATTR() function---this time it's valid and you can change ATTR() to MIN() or MAX().

                     

                    Jim