DATA ANALYST
Download my resume
View My LinkedIn Profile
View My Tableau Public Profile
I tried to implement the Tableau visualizations using LOD expressions made in the blog .
Important Tip: Measures are aggregated when added to the view. Adding a dimension will increase the granularity of the view.
Number of customers who ordered one order, two orders, three others and four others. To create a histogram of the number of customers who purchased 1,2,3,…N times.
Steps:
COUNTD([Customer ID])
and drag it to Rows shelf and set Marks card to Bar type.{ FIXED [Customer ID]: COUNTD([Order ID])}
and convert this to dimension.Link to the created visualisation
To compare a group (cohort) of customers based on their first year of order date and check their contribution to the overall Sales.
Important reference: Tableau Order of expression evaluation
Steps:
{ FIXED [Customer ID]: MIN([Order Date])}
and it will be a dimension.To know the number of profitable days achieved each month or year, especially if we were curious about seasonal effects. The following view shows how LOD Expressions allow us to easily create bins on aggregated data such as profit per day, while the underlying data is recorded at a transactional level.
Here we will set KPIS as :
Steps:
{FIXED [Order Date] : SUM([Profit])}
. This helps us to easily bin the days in a secondary calculation. IF [Profit per day]>2000 THEN "Highly Profitable"
ELSEIF [Profit per day]>0 THEN "Profitable"
ELSE 'Unprofitable' END
COUNTD([Order Date])
and drag it to Rows shelf.Here we will try to find the percentage of sales contributed by each country and also use filter Market.
Steps:
To calculate the total sale use fixed LOD. Create a calculated field Total sales: {SUM([Sales])}
. This will create a single column with constant value of total sales.
To find the overall sale %ge create calculated field Percent of total: SUM([Sales])/[Total sales]
. This will create a single column which has %ge sale for that row.
Link to the created visualization.
What is the daily trend of total customer acquisition by market? Finding the trend in this data will help us understand how well the regional marketing and sales organizations are doing at generating new business. The steeper the line, the better the acquisition trend. As a line flattens out, some action must be taken to increase lead flow.
An LOD Expression ensures that repeat customers are not miscounted as new customers, as data must be evaluated at the customer level even though it is displayed visually by market and day.
Create a calulated field Customer Joining Date: { FIXED [Customer ID]: MIN([Order Date])}
Now created another calculated field to see for a given order date the customer who ordered was an Existing or a New customer. Named the calculated filed is New Or Existing: IIF([Customer Joining date]=[Order Date], "New", "Existing")
COUNTD([Customer ID])
Link to the created visualization.
It’s relatively straightforward to find the difference from average, but what if you wanted to find the difference from a selected category? First, you must isolate the sales of the selected category. Then an EXCLUDE Expression is needed to repeat that value across all other categories. It is then easy to take the difference of each category’s sales from the rest.
Steps:
Create a parameter __ Select a Sub-Category__
Worksheet after adding Sub-category and SUM(Sales) to it and after sorting in descending order.
Need to isolate the sales of sub-category we are interested in this can be done with the help of IF statement and with the help of Parameters to make it more dynamic. So create a calculated field Selected Sales:
IF [Sub-Category]=[Select a Sub-Category]
THEN [Sales] ELSE 0 END
Now right click on the parameter made earlier and select Show Parameter control.
An LOD expression that excludes the category from grouping the sum of selected sales
will total the selected sales across all rows. This will make it easy to compare the sales of each category to the selected category. So create a calculated field Sales of Selected Category : {EXCLUDE [Sub-Category]: SUM([Selected Sales])}
.
Now create another calculated field Difference from selected: SUM([Sales]) - SUM([Sales of selected category])
Now do the following changes in workseet to see difference in sales of each sub-category side by side.
Link to the created visualization