Tableau - creating vertical lines on specific dates when the date axis (x-axis) is set to "week" - date

I'm graphing weekly total page loads per 1000 students, which is easy enough when the pill for the page load variable is set to 'sum', and the date pill is set to 'week number.'
BUT, I also have a table that lists individual dates on which important policy changes occurred, and I want to draw those as vertical lines.
Using a dual axis, I have been able to plot the specific dates as lines, but because the resolution of the date axis is set to "week", it lumps all dates in the policy change table that occur within a single week into one, or possibly omits dates that don't land on the right date for that week, and therefore I don't get individual lines for every policy change.
weekly resolution, dates omitted
I have been able to approximate what I'm looking for by setting the date pill to 'day,' and then doing a rolling average of the page load values--but this doesn't represent the page loads in the way I need it to.
rolling sum, not the same calculation, but includes dates
I need either a way to layer two charts on top of each other, with different x-axis resolutions, or possibly the correct calculated field that gives me the straight up weekly sum of the daily total page loads for successive weeks, so I can use the 'day' setting on the date-time access but still get the weekly values I want, and then plot all dates in the policy change table.

Related

Chart.js Align two time scale axis

We are using chart.js lib Version 3.7.1.We have multichart graph with line and bars. Both using time scale on x axis, but one has one month value, while second has one day value.
example:
const dailyAxis = [27-05-2022, 30-05-2022, 31-05-2022, 01-06-2022, ... 07-06-2022];
const monthlyAxis = [31-03-2022, 30-04-2022, 31-05-2022, 30-06-2022];
The problem is, that daily values could start from the middle of the month or one month could have 20 daily values, other could have 30. Is it possible to align two charts, to have first daily point at start of monthly bar and last point at the end of monthly bar, no matter how many daily values we have?

Highstock charts - Show the blank space up to the current date

Currently, I'm having trouble to force the highstock chart to display a blank space up to the current date. It focuses the data I give it.
What I have is:
What I want is something like this
As you can see I want the data to stop at the date of the latest data point and then the graph should show a blank space and stop at the current date. Obv there is not data points for those times
You can control how empty points, and missing points are shown by looking at:
xAxis.ordinal
In an ordinal axis, the points are equally spaced in the chart regardless of the actual time or x distance between them. This means that missing data periods (e.g. nights or weekends for a stock chart) will not take up space in the chart. Having ordinal: false will show any gaps created by the gapSize setting proportionate to their duration.
xAxis.max
The maximum value of the axis. If null, the max value is automatically calculated.
plotOptions.series.connectNulls
Whether to connect a graph line across null points, or render a gap between the two points on either side of the null.
Which means that for your graph, you will want to set:
xAxis: {
ordinal: false,
max: (new Date()).getTime() //to set the current date and time as a maximum
}

Show Separate Mark Labels alongside Measure Value Labels

(source: tableau.com)
I'm using Measure Values for combining two measures:
1)Count of Clients (As a percentage)
2)% Retention (Calculated field which uses another calculated field called Numerator Retention in it's formula over the total to calculate the %)
Measure Value Mark Labels successfully show the respective percentages for the two measures. Now I wanna show the respective count of clients or numbers behind these percentages but I'm unable to do so since I've already used Measure Value Mark Labels to do something similar.
When I try editing the Labels text, it edits it for all labels together and hence I'm getting all labels for all rows and not how I want it to show selectively as I described.
Example Solution: For Private Residence, I only want 125 to show with 60% which is the actual number behind the percentage. And I want only 119 to show with 95%
You can do this, but not using Measure Values. You should mirror what I have done here. I do not know your calculation for the Respective Retention, so use your calculation.
You need to move both of your measures to the Columns shelf and make them a Dual Axis:
After doing that, you will have access to the individual measures - so you can give labels independently:
Just make sure you place the measures that you want for each axis respectively.

grouped stacked sales column chart

I am trying to produce a sales chart using only the native Excel features, I am trying to group sales data by month and category. I want my sale types to stack for a monthly total so that I can compare not only total volume, but also track where that volume is coming from. I have been able to group by month using a pivot chart, but I can't figure out how group my categories and display them as discrete parts of the monthly sum. Here is a mock-up of what I am trying to produce: http://i.imgur.com/BCFfwQJ.png
I'm helpless in VBA and SQL, and my coworkers are even worse than me at it, so I need to do this with just the built-in Excel 2010 features.
Set up the data so the months are in the first column, type labels in the first row, values in columns under the respective type, and keep the top left cell blank (above months and left of types). Add another column with the quota label next to the type labels and the quota values next to the type values. Make a stacked column chart from this data, right click on the quota series (which is another stacked column), choose Change Series Chart Type from the pop=up menu, and choose a line chart type.

GANTT Chart with Shapes

I'm trying to create something like a GANTT Chart where I would have start dates and end dates designated by a shape like a diamond and then the period of time in between connecting the start and end date shown as a line connecting the shapes. Does anyone have any tips on how to do that in tableau?
For data I have an identifier column, an event column, a date column, a start date column, and an end date column.
To make a basic Ghantt chart in Tableau, put the start date on the column shelf, convert it to continuous exact date. Put the identifier on the row shelf and change the mark type to Ghantt. This should get a short bar at the start date of each task, with a row per task (assuming the ids are unique per task).
Now you need to specify how long the bars should be by putting a field showing the number of days for each task on the size shelf. You can create a calculated field to compute those durations as datediff('day', contract_start, contract_end). Place that on the size shelf and you should be off to a decent start.
You can add more info to the tool tips and use color to show contract type or something else. add some reference lines by right clicking on the axis. You will need some tweaks in the calculated field to deal with things like null (unknown) end dates, maybe recurring tasks ...
If you want a few milestone markers, you can use reference lines or point annotations to add them by hand easily.
Or if you want to include milestones as shapes with your data, you can use a dual axis chart.
Here is an example showing how to combine shapes and bars into one char. The details vary slightly depending on how your data is organized, but if you examine how the data for this workbook is organized, how the data connection joins the tabs, and how the workbook displays the data, you should be able to adapt the approach to your own data. Just realize sometimes it is easier to revise the way your data is shaped to make the analysis simpler.
Also, you might want to consider if you need both planned and actual dates.
See also
Gantt over time with summed bar