5 Replies Latest reply on Sep 24, 2013 12:54 AM by Tim Lee

# show week to date, month to date, and year to date in a cross tab

Good afternoon!

I am make a cross tab which shows for a date selected what the

1) number of leads were that week

3) what is the current 6 week average of those leads

The output I am trying to make is something like the below.

As at 15 Sep 2013 ...

RegionCurrent WeekMonth To Date6 week average
Region 1123150100
Region 256710001200

I have written measures to take care of the lead volumes for current week, month to date, and the 6 week average - but my question is --- can I show just the data for one day using a date selected in a parameter? Whatever I try I loose data from the periods being selected in the windows_avg or windows_sum fields or simply all of my dates dissappear...

I have attached a sample book with where I got up to...

Any thoughts, directions, would be hugely appreciated!!!

Tim

Work book attached

• ###### 1. Re: show week to date, month to date, and year to date in a cross tab

There is no workbook attached, Tim.  Someone should be able to help you once it is posted, though.

• ###### 2. Re: show week to date, month to date, and year to date in a cross tab

Hi Tim,

Creating YTD and MTD Calculations | Tableau Software

Warm Regards,

Prashant Sharma - India | LinkedIn

• ###### 3. Re: show week to date, month to date, and year to date in a cross tab

Thanks Prashant.

Will that solution work for the 6 week averages as well? I will have a go against shortly with your suggested link.

I have attached the packaged workbook - please excuse my new'ness to the product.

Thanks,

Tim

• ###### 4. Re: show week to date, month to date, and year to date in a cross tab

Hi Tim,

Yes these are also working for 6 week averages. You just have to find out out 6th week & it will work.

Warm Regards,

Prashant Sharma - India | LinkedIn

• ###### 5. Re: show week to date, month to date, and year to date in a cross tab

Thank you!

For the 6 week average I used

if [Date] <= today() and datediff('day',today(),[Date])>=-(6*7-1) then [Act_Net]/7 end

1 of 1 people found this helpful