3 Replies Latest reply on Aug 11, 2016 10:48 AM by David Mannering

    use custom sql or joins - newbie

    Jeff Chirco

      I am new to Tableau and trying to figure out the best to way to organize my extracts.  We are currently only using Desktop, not server.  Do most of you use custom sql or do your table joins in Tableau?  One thing I like about doing the joins in Tableau is that when you are looking at your dimensions it separates out your fields from different tables.  But it feels like doing the joins in Tableau is a lot slower than doing custom sql.  Or if you do custom sql do your prefix your columns names with the table they came from?

      Second part of this question is your custom sql a complex query or do you create a materialized view that of the data you need then do you just pull in that one table?

      Our data source is Oracle by the way.

      Thanks for any tips.



        • 1. Re: use custom sql or joins - newbie
          David Mannering

          We use custom SQL mostly, because we usually want to limit the rows or columns or use Oracle functions like Max() or Listagg().  Also we have nested selects inside joins and unions so the Tableau joins are not really usable.  We normally do a complex query in Tableau rather than creating a materialized view because it is easier to quickly make changes without getting our DB admins involved.

          • 2. Re: use custom sql or joins - newbie
            Jeff Chirco

            Awesome thanks!  Do you prefix your column names with where the data came from?  Maybe I am bringing back too many columns (45) but it seems hard to find fields when they are just listed alphabetically.  Like I have "dates" related fields (period, year, week, start and end dates, etc), "store" related fields (division, region they belong to and names), as employee information (manager name, etc).


            I guess this is just personal preference but I am the DBA here and just make the extracts for others to use as I am not really using them so I want to make it convenient for them and curious what others do.  Thanks.

            • 3. Re: use custom sql or joins - newbie
              David Mannering

              We prefix column names with a code representing the data source.  This has the added benefit of eliminating the need to use aliases in the SQL since no column names will be duplicated across tables. (Unfortunately, we have a couple of exceptions to this for historical reasons.)