3 Replies Latest reply on Feb 9, 2017 12:06 AM by PULKIT GUPTA

    How to fool Tableau into treating a calculated field as an original field?

    PULKIT GUPTA

      Hello

      I have 2 tables in a data source which i need to make a join on ID fields named, increment_id & order_id.

      For each value of increment_id, there is a same value of order_id in the other table (as the joins are supposed to work).

      The problem is, that the values are not identical but almost similar.

      Say, value of increment_id is "R101" and the corresponding value of order_id is "101".

      I can create a calculated filed to match them but then i won't be able to join on these 2 fields.

      Hence, can Tableau be fooled into believing in a calculated field as an original one by actually storing the former

      OR is there any other way to go around it?

        • 1. Re: How to fool Tableau into treating a calculated field as an original field?
          Stephen Rizzo

          To the best of my knowledge, that is not currently possible without making changes in the original data source or in the data pull using custom SQL for example. If those aren't an option then you may need to wait for the release of Tableau 10.2 to be able to implement that (see Coming Soon for more details). The feature to look for is "Join Calculations".

          • 2. Re: How to fool Tableau into treating a calculated field as an original field?
            Isaac Kunen

            Hi Pulkit,

             

            Stephen is right that you can't do this today, although depending on your situation, you might be able to work around it with blending. Blending does the join after any calcs you apply, so you could make the ids match and then do the blend.

             

            But, you might look at the "join calculations" feature coming out in 10.2, which seems like an ideal solution to your problem.

             

            Cheers,

            -Isaac

            • 3. Re: How to fool Tableau into treating a calculated field as an original field?
              PULKIT GUPTA

              Hello Isaac Kunen

               

              The problem is now slowed using custom sql query.

               

              2 tables needed to be joined by a reference_id <-> order_id.

              But the values were similar not same in the fields.

              Viz., a value in reference_id = 123 have to be matched with order_id = R123.

              Now, your first thought would be to split the reference_id or prefix an R to order_id.

              But that would make them calculated fields, and those can't be used to introduce a join.

               

              So, using custom sql query, I tried using function CONCAT, but Tableau didn't accept that function. I began to start hit & trial method, & started applying random things.

              At last, I wrote the line in the query which didn't give me the new field as a calculated field.\\

              'R' + reference_id as NEW_order

               

              Hence, finally, the NEW_order and order_id were used to implement a join between 2 tables.

               

              Although the combined calculation thing that you mentioned may solve the problem in future.