3 Replies Latest reply on Oct 3, 2018 5:10 PM by Ken Flerlage

    Switch images when clicked

    Tableau Learner

      So i want my image to be switched when the user clicks on it.

       

      So the steps are

      1. Click on image A

      2. Changes from image A to image B

      3. Moves to the dashboard linked

       

      Is that possible?

       

      Thanks!

        • 1. Re: Switch images when clicked
          Ken Flerlage

          What do you mean exactly by # 3?

          • 2. Re: Switch images when clicked
            Tableau Learner

            Hi,

             

            Currently i can click the image to go to another dashboard (cause it’s linked by URL or something)

            • 3. Re: Switch images when clicked
              Ken Flerlage

              Okay, I'm guessing your primary question is the image thing. If you need help with # 3, let me know, but here's how do to the image thing.

               

              Start out by creating custom shapes for your images. Then drag your dimension to the shape card and assign your custom shapes. Here's an example with a very simple data set:

              Now create a calculated field that will specify our target image:

               

              Target Image

              // This is the image that we want to change to on click.

              IF [Image]="Depp" THEN

                  "Wilder"

              ELSE

                  "Depp"

              END

               

              Drag Target Image to the detail card so that it's available to us in the next step.

               

              Now set up a filter action like this. The key is that you'll use Target Image as the Field and Image as the target. This will tell Tableau that you want to change Image to the value of Target Image. Make sure that you change the "Run action on" to "Select". Also make sure that "Clearing the selection will" is set to "Leave the filter".

              Now click on one of the images. It'll now look something like this:

              As you can see, Tableau's messed with the image size a bit. So fiddle with the size of the mark and the size of the cell until you have it something like this:

              Now when you click the image, it will toggle between Gene Wilder as Willy Wonka and Johnny Depp as Willy Wonka:

              Toggle.gif

              I'm attaching my sample data set and a packaged workbook.

              1 of 1 people found this helpful