6 Replies Latest reply on Dec 6, 2018 5:19 AM by Michael Gillespie

    Group data by day, to display by month

    Terence Mervis


      I have a Sales_Table at the Item_Code level, for example

      Date               Item_Code          Sales_Amount     Profit

      1 Jan 2018     1234                    $45.00                    $20.00

      1 Jan 2018     9876                    $34.00                    $17.00

      5 Jan 2018     5678                    $57.00                    $25.00

      5 Jan 2018     4589                    $17.00                    $9.00


      I want to group the data at the 'day' level, and then display this data by month on a bar chart, such that when i count records, it doesn't count on an item level, but rather on a day level.

      The grouped data table should look like this  -

      Date               Count

      1 Jan 2018     2

      5 Jan 2018     2


      The bar chart should display a bar with a value of 4

      Finally, for this bar chart, I'd like a filter called "GrossProfit%" (a calculated field = SUM(Profit)/SUM(Sales_Amount), selecting only those days with a Gross Profit % between x% and y%.


      Attached is a file of tableau sample data - 'Global_Superstore' which resembles my data and the Filter. Go to the Tab called "Sample99" . Please work with this file. The above example was just to simplify.

      Thanks for your help!