You are on page 1of 4

Last two year sales

Max sales for a quarter in year


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

You might also like