Tableau - Calculation to Display last N quarters data
Автор: Tableau Tip
Загружено: 2019-01-29
Просмотров: 6776
Описание:
Date format in the system: mm/dd/yyyy
Calculation to display Last 4 quarter data
Datetrunc('quarter',[orderdate])
returns starting date of every quarter
Jan- Mar Q1 ( 01-01-2016)
Apr-Jun Q2 ( 04-01-2016)
DATETRUNC('quarter',TODAY())
returns - current quarter starting date
jan-2019 = Q1 = starting date is 1-1-2019
Last 4 quarters data
datediff('quarter',DATETRUNC('quarter',[Order Date]),DATETRUNC('quarter',TODAY()))
return 0 for the current quarter
we need 0,1,2,3 (4 quarters)
-continous line is not possible when there is a change in the year
Making the year quarter field as continuous will not help
if we year, Q1 will be starting , in this case it should be at the last position Q1-2019
str(YEAR([Order Date]))+ " - Q" + str(DATEPART('quarter',[Order Date]))
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: