I have tried multiple approaches to this and still have not figured out how to resolve this issues. It seems the chart is becoming unstacked after the filter is applied. Any ideas anyone?
Are you simply trying to drop the lookup direct to the chart or, have you switched this to tabular view to see what Tableau is actually doing before then moving to the chart.
Please can you provide a mock-up of your progress so far - pref using Superstore Sales.
Hi Steve - thanks for the response. I managed to recreate exactly what I was doing with the Supermarket data. Please see attached.
Your thoughts about checking the tabular view is a good idea. I will try that while you analyze the attachment.
Test Book.twbx 1.2 MB
What are you trying to accomplish with the lookup filter that you cannot do with a regular date filter? Maybe there is a different way to accomplish the necessary filtering.
I think things may be running afoul on account of nulls.
To get around that, I made a variation on the LookupFilter:
LOOKUP(WINDOW_MIN(MIN([Pivot Field Values])),0)
with Calculate Using of PivotFieldValues and ShipMode, restarting every PivotFieldValues.
Added the WINDOW_MIN to force all Ship Modes to have a Date.
Please see workbook attached in Forum Thread.
273836lookup2.twbx 1.2 MB
Swaroop - thank you for this solution, it definitely fixes the filtering issue I was having.
However, while it works in the sample workbook, it isn't translating perfectly to my actual workbook for some reason. The difference that is happening is on my actual workbook, the chart is not showing all dates in the given time range. As I scroll over the dates on the graph, it skips dates. It provides a more "spiky" graph rather than blocky like in my original picture (which shows all dates even if no "event" is occurring). Do you know why this is? Below is the picture of the graph.
There may be a few more settings needed for the table calculations.
Could you post a screenshot of table calculation settings for [LookupFilter]?
It also may be helpful to see a picture of the worksheet
with all the pills on the different shelves.
I don't think this will help, but I'm curious of the
effect that left-clicking on the "8 nulls" and trying
some of those options.
The next step would be to ask if it be feasible to scrub
your data from identifiers and post a portion of your data
that has the nulls in question.
Swaroop - please see below for both the table calculation and the pills. I did notice that selecting on the Date Lookup Filter the bottom right checkbox that says "Include Null Values" causes it to have all dates and return to the blocky view, rather than event-by-event view as shown below.
I suppose to reframe the issue, I am wanting the chart to maintain a given value until it changes, then go straight up or down, rather than gradual declines or inclines between two points, which isn't an accurate representation of the data.
Jenell - thanks for the response. I am trying to filter the chart according to a date range, but because the chart is based on running sums, it will inherently recalculate the chart based on what is in the view. This causes the graph to have negative values, which is undesired. After research, I found a lot of people saying Lookup() filters were a good option to filter the view but not the data, thus maintaining the chart integrity. After several attempts I ended up with the original two screenshots.
If you have any ideas around this, I would gladly take them!
Thanks for the screenshots. Setup looks fine.
Will make a suggestion first about the nulls.
Though it's possible that this may not work for your
particular true dataset type.
This employs the method of using a cross join
to a single column of all possible dates, as described here:
The lookup table used is attached.
What this does is allow for is the plotting of every date.
If there was a particular null date for orders, say, the running sum
for the difference will continue along the last value.
Please see below screenshots.
And it does also simplify the [LookupFilter] since there aren't
any more nulls.
However, what this does not do is what you had requested, which is to
continue horizontally until the next value then drop vertically.
Will discuss that in next post.
273836lookuptable.xlsx 45.3 KB
With regards to having a stepped view,
I'm finding it tricky to obtain as a stacked area chart.
One suboptimal alternative is to just use a stacked bar chart.
See image below.
Another suboptimal alternative is to use a line graph.
I'm not sure if v2018.1 is an option for you, and you may have
already seen this, but it has the option to make line charts in the
step manner that you would like, and it can stack the shipmodes.
Please see image below.
If you can only use v10.4, I've attempted to recreate the step chart
using the methods described here:
However, it does not seem to be playing well with ShipMode and stacking.
Will continue to look into it.
Please see v10.4 workbook attached in the Forum Thread.
273836lookup3.twbx 2.3 MB
Certainly open to other ideas from the Community.