3 Replies Latest reply on Aug 23, 2016 7:33 AM by Tom W

    Week Dates in a Legend

    Paul Norton

      I'm trying to organize a line graph by Weeks of the month.  I've built the viz and it works pretty well except the legend.

       

      I'm using an actual Date MM:DD:YYYY field, and I really Wish I could set the legend to show Either The start Date or the "Thru Date" (EX Jan 1-5)

       

      I've been searching across the web and forums and I'll I can ever find is a calculation for converting actual week numbers to a starting date, but I don't seem to be able to effect the legend labels with any calculations?

       

       

      Screen Shot 2016-08-22 at 4.42.50 PM.png

        • 1. Re: Week Dates in a Legend
          Tom W

          When you're dragging 'Date' onto the color button, drag it by holding the right click button or your mouse. When you release the mouse button on the color card, you will get a selector to chose the aggregation level / type. Select the lower / second version of the WEEK(Order Date) in green text. Then right click your WEEK(Order Date) on the marks card and select continuous.

           

          Another method would be to use the DATETRUNC formula to create a calculated field which truncates it to week level.

          2 of 2 people found this helpful
          • 2. Re: Week Dates in a Legend
            Paul Norton

            Thanks for the response Tom,  Your answer got me close enough.  I'm on a Mac and the right click Function doesn't seem to allow me to drag Date over to the Marks section.  Instead it just popped up a context menu. I tired command click and a few other options but no luck.

             

            However, I was able to Drag Date over to marks, I selected More -> Custom in the context menu:

            Screen Shot 2016-08-23 at 8.32.22 AM.png

             

            In the drop Down box I selected week numbers & Date Value.

             

            Screen Shot 2016-08-23 at 8.32.40 AM.png

             

            This gave me a continuous Legend, So The graph was still broken up by weeks, but the legend was not.

             

            On the marks Card I changed the data to discrete, and now my legend at least shows the start of the week date. 

             

            The first one is a bit out of range, but its better than just week numbers.

            Screen Shot 2016-08-23 at 8.37.28 AM.png

            1 of 1 people found this helpful
            • 3. Re: Week Dates in a Legend
              Tom W

              I believe holding the command button while dragging should achieve the same thing on Mac. I'm glad you got it sorted.