1 Reply Latest reply on Sep 3, 2015 2:07 PM by diego.medrano

# Calculating Sum and count based on time display

Hi Tableau guys,

I have a dashboard where  i can select between monthly , weekly and daily views and i wanted to customize the header and include the "sum of my income / count ( of my projects)"  .

The  header part should look like this :

Monthly view :

JUNE

305 / 15

Weekly view :

JUNE 29

134 / 5

Daily view :

JUNE 29

15/ 2

i have  already the date part customized for different views . i need the sum and count part

if [Select View]="Daily"

then str(LEFT(datename('month',[Cal Date]),3)) + str(" ") + str(datepart('day',[Cal Date])) + str(" ") + str(YEAR([Cal Date])) + CHAR(10)

+ "sum of my income / count ( of my projects)"

elseif [Select View]="Weekly"

then str(LEFT(datename('month',datetrunc('week',[Cal Date],'sunday')),3)) + str(" ")+ str(datepart('day',datetrunc('week',[Cal Date],'sunday')))+ CHAR(10) + + "sum of my income / count ( of my projects)"

elseif [Select View]="Monthly" then

str(LEFT(datename('month',[Cal Date]),3)) + CHAR(10) + + "sum of my income / count ( of my projects)"

Any help would be appreciated.

Thank you

M.

• ###### 1. Re: Calculating Sum and count based on time display

Hey Mohammed,

This seems like the type of question that wouldn't be too difficult to answer with a packaged workbook. If you could provide the workbook, I'm sure someone could take a second look. Or, if you've found a solution, let us know.