So I have been playing with this one widget for a few days and I can't seem to filter it right to get what I want on a line chart.
We do an Art Happy Hour every Thursday night over the summer that is free to attend for everyone (members, non-members, doesn't matter). It's from end of May to beginning of September.
I would like a line graph that shows year over year, so Summer 2022 on one line, Summer 2023 on a second, etc.
I need it to go in date order (so left to right May - September) on the x axis with the labels of each Thursday by date (so 8/3/23, 8/10/23, 8/17/23, etc.)
My problems start because of when our Fiscal Year is. Our FY is July 1 to June 30, which is smack-dab in the middle of Art Happy Hour's run. Either because of Fiscal Year or some other filter, the months seem all out of wack (it'll start with August, then go to May, then September, before going back to June and July).
Can someone tell me what I have to put on the X axis, value, and break by in order to get what I want?
Here is a screenshot of the dashboard and the filters currently. I'd show you it flipped to a line graph, but it gets really wonky.
Hi Chelsea,
Given that the date in the prior year's Thursday for the given week of 2023 will be different, would you expect the 8/4/22 numbers to render against the 8/3/23 axis label? If that's okay, then you could use Weeks in Performance Date instead of the fields you current have on Categories, and change the date formatting to show MM/dd/yy, and then we could apply a script (at the end of this post) to the widget to adjust that label to 3 days later.
Then instead of using a Break By, use a duplicate of the Ticket Attended Count and apply the PREV() function, to return the count from 52 weeks prior...
( [Total Ticket Count] , PREV( [Weeks in Performance Date] , 52 ) )
In order for this to work, the Calendar Month filter is also replaced by the same Performance Date field that is on Rows/Categories, but grouped by Month with only 05/2023 through 08/2023 selected.
Note that the scripts behind these widgets that change the date to Thursday for the given week are different between the Pivot and Bar (Bar version works for Line, Column, Area) charts.
Pivot
widget.on('ready', function(){ $.each($("tbody .p-head-content span",element), function(){ var span = this.textContent; var new_date = new Date(span); new_date.setDate(new_date.getDate() + 3) new_date = (new_date.getMonth()+1) +'/'+ new_date.getDate()+ '/'+ new_date.getFullYear(); this.textContent = new_date; }); });
Bar
widget.on('processresult', function(widget, args ){ var dates = args.result.xAxis.categories; var new_dates = []; dates.forEach(function(category){ var new_date = new Date(category); new_date.setDate(new_date.getDate() + 3); new_date = (new_date.getMonth()+1) +'/'+ new_date.getDate()+ '/'+ new_date.getFullYear(); new_dates.push(new_date) }); args.result.xAxis.categories = new_dates; });
WeeklyThursdayTY_2D00_LY.dash
Chris Wallingford For some reason the Network won't let me reply back to your reply below. I tried your suggestion and it shot an error (the whole widget has a red triangle with an exclamation point, that when I hover over it says "Error Querying Your Data Model."
And it's still keeping it all on the same line. I need 5/22-8/22 on one line and 5/23-8/23 on a second line. So I guess the x-axis can't go by exact date. How else can I get it to show every Thursday for those selected months?
If you return to your original widget and instead of Calendar Month use Calendar Month Sort, it will order the months correctly. Then instead of breaking by Season Fiscal Year, use the Performance Date Calendar Year.
A problem is that this should look fine with a column chart, but a line chart with two fields on Categories will break the line between changes in the first category (Calendar Month Sort). Will a column chart suffice?
We'd prefer a line chart just so it's easier to visualize the trends across the weeks and compare one summer to the next (or in this case one before to forecast the next).
I just played with it some more and have almost exactly what I want. I just need the x-axis broken down further by week instead of the whole month total. So keep the months but also go by week within that month...if that makes sense. I want 4 points in the June section, 4 points in July, etc.
Adding Calendar Week of Month after Calendar Month Sort will do it, but Analytics doesn't connect a line chart across the top-level field when there are two fields on the Categories panel. Still, this may be sufficient?
And that's what I need (for it to connect across top-level). Something to add to the Ideas Board I guess. I will keep it month for now and hope something comes of the idea, or that our data gets better the longer we are in the system.