This document contains various metrics and calculations related to sales analysis including:
1) Metrics for the last two years of sales such as maximum sales per quarter and dates for the first and last days of months and weekdays.
2) Calculations for the first and second half of years, quarter-over-quarter changes, and rolling averages of sales and correlations between sales and profit.
3) Formulas to calculate month-to-date, year-to-date and rolling window averages of sales for comparisons across quarters, years and date ranges.
Original Description:
It has tableau calculations for different scenarios
This document contains various metrics and calculations related to sales analysis including:
1) Metrics for the last two years of sales such as maximum sales per quarter and dates for the first and last days of months and weekdays.
2) Calculations for the first and second half of years, quarter-over-quarter changes, and rolling averages of sales and correlations between sales and profit.
3) Formulas to calculate month-to-date, year-to-date and rolling window averages of sales for comparisons across quarters, years and date ranges.
This document contains various metrics and calculations related to sales analysis including:
1) Metrics for the last two years of sales such as maximum sales per quarter and dates for the first and last days of months and weekdays.
2) Calculations for the first and second half of years, quarter-over-quarter changes, and rolling averages of sales and correlations between sales and profit.
3) Formulas to calculate month-to-date, year-to-date and rolling window averages of sales for comparisons across quarters, years and date ranges.
Last Day of the Month First Day of the Month Weekdays 2 half years QoQ Window_Avg fun Window_corr- applies to entire view corr- applies row wise WINDOW_AVG Sales for MTD Sales for YTD YEAR(MAX([Order Date]))>=WINDOW_MAX(MAX(YEAR([Order Date])))-1
DATEPART('quarter', MAX([Order Date]))=
WINDOW_MAX(DATEPART('quarter', MAX([Order Date]))) { FIXED MONTH([Order Date]):MAX(DAY([Order Date]))} { FIXED MONTH([Order Date]):MIN(DAY([Order Date]))} DATENAME('weekday',[Order Date]) IIF(MONTH([Order Date])<7,'1st half','2nd half') LOOKUP(SUM([Sales]),4) WINDOW_AVG(SUM([Sales]),0,3) //average sales for 4 qtrs WINDOW_CORR(SUM([Sales]),sum([Profit])) CORR(SUM([Sales]),sum([Profit])) WINDOW_AVG(SUM([Sales]),-3,2) if [Order Date]>=date(DATETRUNC('month',TODAY())) AND [Order Date]<=TODA if [Order Date]>= date(DATETRUNC('year',today()))AND[Order Date]<=TODAY()T Previous 3, next 2(e.g for calculating for April consider from Jan to June). If start(-3) and end(2) removed then AY()THEN[Sales]END THEN[Sales]END n it considers entire range