3 Replies Latest reply on Sep 2, 2016 8:34 AM by David Li

    Cannot mix aggregate & non-aggregate functions

    Laura Vecchio

      Good Morning!

       

      I'm extremely new to both Tableau & SQL. I've searched the forum but can't seem to find a thread to answer my question so I was hoping someone could help?

       

      I have two data sources;

      - MS SQL Server - retrieving actual billings

      - Excel - importing the annual budget

       

      This is for multiple subsidiary companies, the join (which at present is 'inner', I need it to be 'right' but that's a different query altogether!) is based around the company name.

      I've had to change the aggregation on the budget figure field to AVE as otherwise I was experiencing duplicated data due to there being multiple bills raised on Company X and the budget figure replicated itself across all of these rows.

       

      I now need to create a calculated field to show the variance between the actual billings and the budget but due to the mis-match in aggregate & non-aggregate, it won't work.

       

      I don't understand either tool enough to be able to figure out a work around so any help would be much appreciated!

      Many thanks
      Laura