1. How would you identify the customer who contributed the highest profit in each region?
Use Rank on Profit and partition by Region.
RANK(SUM([Profit])) = 1
Compute Using: Customer Name
Partition By: Region
This returns the top profit-generating customer in every region.
2. How would you calculate the average number of days taken to ship an order?
Calculate the difference between Order Date and Ship Date.
AVG(
DATEDIFF(
'day',
[Order Date],
[Ship Date]
))
This measures shipping efficiency.
3. How would you identify products that have sales in every month of the year?
Count distinct sales months and compare with 12.
{ FIXED [Product Name] :
COUNTD(DATETRUNC('month',[Order Date]))
} = 12
This identifies consistently selling products.
4. How would you calculate each customer's share of profit within their region?
Divide customer profit by total regional profit.
SUM([Profit])
/
WINDOW_SUM(SUM([Profit]))
Set Compute Using: Customer Name.
This shows profit contribution within a region.
5. How would you identify orders where discount is given but profit is negative?
Filter orders having discount and loss.
[Discount] > 0
AND
[Profit] < 0
Useful for identifying poor discounting strategies.
6. How would you calculate the average revenue generated per active month?
Divide total sales by distinct active months.
SUM([Sales])
/
COUNTD(
DATETRUNC('month',[Order Date])
)
This gives average monthly revenue.
7. How would you identify customers whose latest purchase amount is higher than their average purchase amount?
Compare latest order sales with customer average sales.
IF [Order Date] =
{ FIXED [Customer ID] : MAX([Order Date]) }
THEN [Sales]
END
Compare it against:
{ FIXED [Customer ID] : AVG([Sales]) }
This identifies customers whose recent spending is above their historical average.
Top Tableau Scenario-Based Interview Questions Set
ReplyDelete