2 Replies Latest reply on Jan 2, 2018 9:34 AM by Austin Miner

    Replacing Data Source when Measures aren't 1:1

    Austin Miner

      I was wondering if it was possible to manipulate / use logic statements to assist a data source replacement. All our data is in a single result measure, that is then filtered by an identifier. In this example, you could expect something like:


      Var = [x,y,z]


      And then if we want to see x we filter by Var=x only, and then results will display the x data (unfiltered results would display x, y, and z). They are expanding most of this, so instead we will have a x,y, and z data measure. In this case, the manual fix would be to:


      1) Remove the Var filter, as it would no longer exist.
      2) Remove the Result measure, and then display the x measure where results was.


      And this would produce the same result, in the new database scheme. We use tableau a lot, and doing this manually would take a lot of time that. If possible it would be preferential to automate this replacement process. I was wondering if it would be possible to do this, I've been looking into Python/TabPy, but from what I've gathered there it looks like you can't directly manipulate tableau with it. It'd be great if I could setup a series of logic statements that did something like:


      If there is a filter for Var and it is filtering by x, delete the filter and replace the old results measure in rows with the x measure.
      If Var y filter, etc. etc.


      I know the answer to this is probably "you can't automate that", but thought I'd ask before we dive into the deep end. Thank you so much for your help!

        • 1. Re: Replacing Data Source when Measures aren't 1:1
          Shinichiro Murakami

          Hi Austin,


          I am not sure I understand your request correctly, anyways.

          If you want to show text basis x,y,z, below is one of the approach.


          Data set






          • 2. Re: Replacing Data Source when Measures aren't 1:1
            Austin Miner

            Sorry for any confusion. Our databases are getting upgraded soon, at the moment a lot of different data is stored in a single measure, [Results]. We then have to filter it by what we want, using an identifier variable (in this example, we filter by [Var] = x, this then will show [Results] with only x being shown. x, y, and z are different data measurements.) They are changing it so that all of these different measurements aren't stored in the same location, [Results]. So:


            Current measures from our database:


            Which are being changed into (database side):





            Edit / further clarification:
            in current database, [Results] has [x] [y] [z] in it, but has to be filtered by [Var] to only show which of them the user wants.