Campaign performance in Tableau - tableau-api

I am doing campaign analysis in Tableau where I want to see the percentage of leads that has seen 1 campaign,percentage of leads that has seen two campaign and so on in pie chart filter by month and region before they convert to customer.
For e.g in below sample data set there are 5 leads in February of which only lead id abc has seen two campaigns and rest four has seen one campaigns. So the view will be pie chart where 20%(1 out of 5) of lead has seen two campaigns and rest 80% has seen 1 campaigns. If March is selected then pie chart will be 100% one campaign as there is only 1 lead.
If in region filter US is selected then there are three unique leads(abc,efg,klm) in february and view will be pie chart with 33% lead has seen two campaigns and rest two i.e 77% has seen 1 campaign.
I got idea from the link here but not able to do it when month and region filter is added.
Campaign analysis in Tableau

Just add two calculated fields both LOD, as detailed below-
Campaigns per Lead as
{ FIXED [Lead id] : COUNT([Campaign])}
'Measure_val` as
COUNTD([Lead id]) / ATTR({ FIXED : COUNTD([Lead id])})
Format Measure_val as per cent in number format.
Add your filters to view, add both filters to CONTEXT by right clicking them (Note: In order to have filters calculated before LOD calculation. Normal filter calculates the view after LOD fields are calculated). Check whether filters have been greyed out.
Convert Campaign per Lead to dimension by right clicking it.
Add Measure_val to size, angle and text(for label-optional) and Campaign per Lead to color and text(optional again) and you're done.
Do tell if it worked.

Related

Last touch marketing campaign view in tableau

In campaign analysis I want to view in Tableau what is the last campaigns that a lead has seen in a particular month and region. A lead may saw multiple campaigns.
For e.g. in sample data set below Lead id abc has seen two campaigns – webnair, email and last one is webnair.
Lead id efg also has seen two campaigns webnair and email and webnair is the last one. Lead id fgh has seen one campaign - Tradeshow
So in filter(month and region will be in filter) when February and US is selected the view will be a bar plot showing webnair as count 2 and tradeshow as count 1. This will give an idea of which campaigns happens mostly before the lead converts to customer.
Had some insights here Campaign performance in Tableau. Tried replicating here with some changes but no luck so far.
Like earlier ones this one is also not difficult.
Create Desired_field by adding a calculated field as
if [Month] = {fixed[Lead Id]: MAX([Month])} then 1 else 0 END
Create a view like the screenshot. (Note: Don't forget to add filters to context!)
Please note that in case of UK, and if FYU the two campaigns are on same date. This will count both campaigns in the view in case of Feb and UK are selected.

How to sum two different group by calculated fields in Tableau?

I have two calculated fields (HomeScore, AwayScore) and I grouped them by different dimensions(Home, Away). Now, I have TotalRuns per Team both in HomeGames and AwayGames. My problem is that I want to find the sum of TotalRuns per Team not separetely for home games and away games. I want to add these group-by fields somehow. I attach a screenshot to see my work. For example first column for both charts is "Arizona Diamondbacks" which has 263 Runs in first chart and 337 in the second one. I want to show the 263+337=600 Runs. Any Idea?
You'll want to create a LOD expression.
{FIXED [Team Name] : SUM([Total Runs])}
Think of your data as a big table (which it technically always is in Tableau). Every grouping, filter, etc. that you do narrows down the number of columns and rows you have left until you are left with your data set that contributes to your chart. LOD expressions allow you to back out of the filters, etc. in your calculation. In this case, you narrowed down to home or away games, and we are backing out of that to get a bigger picture of the data.

How to show missing dates on PowerBI Clustered Column Chart

I have a data set which has incidents resolved w.r.t date. I would like to look at the trends of number of incidents resolved over the past 45 days only on a Clustered column chart.
I couldn't see entries for specific dates (because the number of incidents resolved was zero on that day). How do I include those dates as well showing the number to be zero?
I tried the following:
1) Enabling "Show items with no data" - While this working fine, it is removing the last 45 days filter and is showing me unnecessary trends. The last 45 days filter is set on a page level and report level filter as well.
2) Creating a new measure to replace null values with 0 when the count of incidents resolved on a particular day is 0 - It again removed last 45 days filter.
Someone please let me know what I can do to get the required trends over last 45 days.
Thanks
This can be late reply, but I hope it may be useful for future users. As I suggested in a comment, you can try using measure for achieving this.
I have designed the following table with sample data.
INCIDENT_RECORD Table:
Created Measure:
Total Incident = IF(SUM(INCIDENT_RECORD[Resolved Incident])=BLANK(),0,SUM(INCIDENT_RECORD[Resolved Incident]))
Now I have designed Clustered Column Chart with & without Measure to show difference for you.
Clustered Column Chart with/without Measure:
First graph is showing label as 0 (Zero) which doesn't have any value
for that date.
Second graph is not showing data for Jan-03 in your case.
Feel free to ask your doubts/clarifications in the comment section.
First, make sure the column on your x-axis is a date data type. Then go to the Format tab for the visual and under the X-Axis options, set the Type to Continuous (rather than Categorical).

Add a Calculated Row For Custom Subtotaling

I'm trying to perform custom subtotaling on sales data to give a total for US and Non-US sales offices. My worksheet looks like the table labeled "current" and I am trying to make it look like the table labeled "desired result"
When I tried to group the sales centers as US and Non US the pill (dimension) was greyed out. After googling through a bunch of threads I found that grouping was not supported for secondary data sources. Is there anyway to do a manual calculation in the table calculations to add a row or do custom subtotaling?
Add a column for the country (assuming that you have the country in your data)
[see my example I had states and zip codes]
Then go to analysis > totals > check on show grand total and on add all subtotals
Visit Calculations totals - Grand total turn on for more information.

Displaying different sheets at user's demand in a single dashboard -- Tableau

I am new to Tableau. I am not sure if I can use Tableau to create the following type of interactive dashboard.
Say I have two almost irrelevant data sources. The first one contains daily revenue for some department stores.
Store Name Date Revenue
-----------------------------
Macy 6/29/16 50,000
Century 21 6/29/16 46,000
Macy 6/28/16 45,000
Century 21 6/28/16 48,000
...
I want to use line chart to study the Revenue. So I would use Date as the horizontal axis, and Revenue as the measure, while using Store Name as the color dimension. As a result, it will render several color lines to capture the revenue in terms of date.
For my other data source, it contains similar things. But instead of doing department stores, it contains information about fast food chain restaurants.
Restaurant Date Revenue
----------------------------
KFC 5/1/16 50,000
McDonald 5/1/16 46,000
KFC 5/2/16 45,000
McDonald 5/2/16 48,000
...
I use line chart to study the revenue again.
Now with the dashboard, is there any way I can have a control with menu Fast Food and Department Store, so that if the user clicks Fast Food, the line chart involving Fast Food appears and if the user clicks Department Store, the line chart involving Department Store appears?
So far, I've been able to use this helpful article http://kb.tableau.com/articles/knowledgebase/multiple-sources-one-worksheet to display Fast Food and Department Store at request. But if the user clicks Fast Food, he will get only one line, instead of multiple lines (one for each restaurant).
I hope I have described my problem clearly.
You can fairly easily do this using a parameter control and using it as a filter in your sheets.
First, create a parameter control "View Control":
Next, create a calculated field based on the parameter for each data source:
The calculation should match the data source ('Fast Food' for the fast food source, and so on)
Then place the calculated fields in the filter card and set to True. This should hide one of the sheets and show the other. They should never be shown or hidden at the same time.
Lastly, place both sheets and the parameter control onto a dashboard. It is best to place the two sheets within the same layout container. You should get the following result:
change parameter: