1 Reply Latest reply on Sep 16, 2013 10:45 AM by Daniel Seisun

    Save a crosstab as a datasource

    Mark Ewing

      Hi! I'm very new to Tableau (just got it last week) and I'm trying to recreate a system that was built in Excel in Tableau.

       

      I have two different data sources (sales prices and material costs), each data source needs to be filtered, then for the sales prices there's a calculated field to get average price per unit and then I need to join the filtered results (including the calculated field) and do some more calculations and start producing graphs.  Data is only relevant at the month level, so it's averages across the month.

       

      Right now I have both raw data sources read into Tableau, but while there are hundreds of sales price entries for each month, there's 8 each month for the material cost (different sources of purchasing it).  If I setup a relationship between the two files on the date (Month/1/Year) only 8 of the sales price entries are used in graphs that I make.  What I really need to do is take the average of the 8 material costs (or fewer depending on the filtering I want/need to do) and match that up with the average of sales price per unit for the month.

       

      In Excel I accomplished this by doing the filtering/averaging for each dataset on a separate worksheet, then using a match statement to join the results.

       

      So, what I want to know is, when I create a crosstab, can I save that as a dynamic dataset that can be referenced elsewhere?  That way when filters are changed the data changes are propogated through to the graphics in the dashboard?

        • 1. Re: Save a crosstab as a datasource
          Daniel Seisun

          The short answer is no unfortunately. You can really think of Tableau as just a query/rendering engine, and not a data source.

           

          That said if you wanted to go down that road what you could do is write custom SQL to join the two tables together. Does each sale have an associated material cost? If so then it would be a simple join to bring in the material cost for each sale, otherwise you would have to do some custom SQL that may require some help from someone more familiar with SQL.

          1 of 1 people found this helpful