5 Replies Latest reply on Aug 25, 2015 3:01 PM by Kris Erickson

    Change color using parameter when connected to SSAS data source

    Nathan Skousen

      I'd like to give our server interactor users the ability to change the dimension on the color shelf based on a parameter when connected to an SSAS data source.  For example, I have a bar graph that defaults to show sales channel by color.  I'd like for the user to be able to change the color shelf to show color by product category dimension using a parameter.  This way the parameter will have values such as "Sales Channel", "Product Category", "Country", etc.  Basically a list of various dimensions that might be interesting to the user.  I know this can be done when connecting to a relational/flat file source but I can't figure it out when connecting to a multi-dimensional source.  Any ideas??

        • 2. Re: Change color using parameter when connected to SSAS data source
          Mark Holtz

          Nathan,

          I am not well-versed in SSAS data sources, but if someone were asking this question regarding a relational database source, I would suggest the following--it may be possible in Tableau even with the multi-dimensional source.

           

          My thought would be that you'd pair a parameter with list string value options of "Sales Channel," "Product Category," and "Country" with a calculated "Color by" field:
          IF [Parameter] = 'Sales Channel' THEN [Sales Channel]
          ELSEIF [Parameter] = 'Product Category' THEN [Product Category]
          ELSEIF [Parameter] = 'Country' THEN [Country]
          ELSE 'Other' END

           

          Now that I think about it, I'm doubtful it'll work for you, but maybe it could be useful to another forum reader.

          • 3. Re: Change color using parameter when connected to SSAS data source
            Russell Christopher

            Hey Nathan -

             

            I'm afraid you're not going to be able to get there exactly the way you'd like to. The main problem (as I'm sure you've discovered) is that you can't get at your cube dimensions via the Calculated Field dialog when connected to a cube. If you can't get at the things, you're done before you started.

             

            The only way that you can see these suckers is if you create a Conditional Filter "By Formula", at which point you can see (only) the dimensions already in play on Rows/Columns/Level of Detail. This still won't help you, though.

             

            So, my advice to you would be...to cheat.

             

            Create X copies of the same viz, each with a different dimension on the color shelf. Then, switch batch and forth between the X sheets based on a value someone selects in a parameter. Here's an example of how to do the second bit: http://www.alansmitheepresents.org/2011/03/changing-viz-types-with-dashboard.html

             

            Hope this helps a little...and sorry for the kludge

            • 4. Re: Change color using parameter when connected to SSAS data source
              Kris Erickson

              I realize this is old, but there is a solution.

               

              The key is to have a secondary datasource (relational) that contains the same dimension information as the cube and data blend in Tableau the cube to the secondary dimension.  Then create the "color yes/no" calculated field in the secondary datasource.  Create the parameter off of the same dimension in the secondary (not the cube, as it may call it [dimension].[element].[832] or something).  Build the view from the cube as needed, and then drop the color calculated field into "Color" and it should work. 

               

              CubeBlend.PNG

              • 5. Re: Change color using parameter when connected to SSAS data source
                Kris Erickson

                Sorry for the late reply again, I see now if you use a calculated member in the Dimensions pane (you have to hover over a small patch of blank space at the bottom of the pan) and choose "Calculated Measures...", you can create a new member with the formula:
                     [Stores].[DivisionName].CurrentMember.Name

                 

                Then you can get it on the Measures shelf and interact with it and the parameters more 'naturally'.