2 Replies Latest reply on Dec 27, 2016 3:57 PM by Michael Chung

    Conditional Labelling on Running Total

    Michael Chung

      Hi Guys,

       

      I am doing a line chart where after very 3 months i would like a label appear to show the running sum after every three months as shown below where the grey lines are. 

       

      Tableau Help.png

      However, I have tried to create a calculated field to show these running values only at the end of every month but i am getting the errors below.

       

      tableau running total 1.png 

       

      I was wondering if anyone out here has tried to do what am I trying to do or has any ideas on how i can get this done.

       

      Thanks

        • 1. Re: Conditional Labelling on Running Total
          D Barnetson

          Hi Michael,

           

          Well, seeing that you have aggregated a measure within your calculation with 'running_sum(sum([Measure]))' you will have to aggregate the 'datename' components of the calculation by adding 'ATTR()' to your date dimension. See below:

           

          IF Datename('month',ATTR([Date])) = 'March'

           

          Though, it may be easier for us to help if you were to include a sample by attaching a packaged workbook, even if it's just sample data.

           

          Let me know if adding the ATTR() to you calculation made a difference. If so, we'll work on trying to help you through the rest of your request.

           

          Don

          2 of 2 people found this helpful
          • 2. Re: Conditional Labelling on Running Total
            Michael Chung

            HI Don,

             

            This has helped. However what I had to do was in my sql server, I had to create a table where all the values are aggregated by month.

             

            thank you