http://www.tableausoftware.com/learn/tutorials/on-demand/funnel-charts
But, there are a few things that the trainer didn't elaborate in order to make a complete funnel chart in practice. So here you go.
1.Get data in order
Before creating a funnel chart, you need a simple table with 2 columns: Phase (dimension) and Value (measure). This step is required especially if you have a dynamic data source for each phase.
In our example, we assume there are 4 phases as follows:
Phase
Visits
Leads
Opportunities
Funded
Just copy the above 5 rows (1st row being the column name) and paste it into a blank worksheet in Tableau. You will have one dimension: Phase.
In practice, the values for each phase may come from the aggregation of different calculations or different data sources. For example, one is from Google Analytics and another is from Salesforce. We need to create a calculated field to calculate the values for each field.
Right click on the dimension "Phase" to create a calculated field "Value". The expression will be something like
if attr(Phase)="Visits" then sum(Google_Analytics.Visits)
elseif attr(Phase)= "Leads" then sum(Salesforce.Leads)
elseif attr(Phase)= "Opportunities" then sum(Salesforce.Opps)
elseif attr(Phase)= "Funded" then sum(Salesforce.Funded)
end
Note that we need to use attr() because otherwise, Tableau will complain that we can't mix non-aggregate and aggregate values in an expression.
So the above is the pre-requisites for a funnel chart with dynamic data.
2.Sync dual axis
At a certain moment in building the funnel chart, we need to use dual axis and synchronize both axis. However the synchronization is not straightforward. Actually we need to convert all values to Float for both axis to sync. This seems not documented anywhere. I found this workaround in this thread:
http://community.tableausoftware.com/thread/109657
So, the previous expression becomes:
float(if attr(Phase)="Visits" then sum(Google_Analytics.Visits)
elseif attr(Phase)= "Leads" then sum(Salesforce.Leads)
elseif attr(Phase)= "Opportunities" then sum(Salesforce.Opps)
elseif attr(Phase)= "Funded" then sum(Salesforce.Funded)
end)
3.Fix a graphical glitch
There could be some annoying glitch showing up in the funnel chart. See the chart below and compare them. You will see the glitch in the chart on the left between blue and green.
Basically we need to swap "-Leads" and "-Visits" in "Measure Values". Because Tableau paints the colors in certain order. There is the right order and the wrong order. The wrong order will produce glitches! We have to respect the right order.
4.Label properlyThe usual labeling approach won't work for the funnel's phases. One can't just drag and drop Phase and Value into the Label shelf, because the funnel is a complex chart that has got multiple components. You will see multiple labels at the same spot if you use the conventional labeling. The trick is to use "Mark in Annotate". Right click anywhere in the area of interest and select Mark in Annotate.
Now we will be able to edit the labeling text and variables in Mark.
Next, let us right-click to format the mark label by removing the line and arrow. It is done by setting them as "None" in the formatting panel.
*All the data used here are fictional.
I have a the phase in different columns..how do I deal with it?
ReplyDeleteJust seen this....
DeleteYou need to scaffold the data so that they are in the same column. Here is an example
http://vizdiff.blogspot.com/2016/05/turning-measure-names-into-dimension.html
What if each of the stages do not have decreasing measure figures, the funnel will not hold it's shape, i would like to have funnel shape regardless of attached measure values, maybe adjusting the height of the area to match measure value.
ReplyDeleteJust seen this....
DeleteYou can create an extra column with numbers like 8,6,4,2. Create chart based on this column. Label the chart using the column with real numbers.
Someone followed the online tutorial and couldn't get the funnel chart in shape. He sent me the workbook and I found out that he needs to set the option Stack Marks to Off in the Analysis menu.
ReplyDeleteStruggling with assigning colors to Phases in a smooth chart.
ReplyDeleteTutorial doesn't do that, you've do but I cannot see how from your steps.
Any chance you can post a screenshot of your workbook so that its entire structure can be seen?
You can download the workbook above. The one with two funnel charts side by side. Have you noticed? Sorry a little late seeing your comment.
DeleteCould you explain how you got the Funded category to appear? I'm trying to replicate and changing the mark to Gantt but can't seem to figure it out.
DeleteWatch the video at the beginning of this post.
DeleteHi Alex can you please create some video so that will be very useful to every one
Deletehi can you please provide some steps so that i can create this type of chart. just i have followed your steps but still am not able to create this chart.
ReplyDeleteThanks In Advance