10 Replies Latest reply on Jun 28, 2017 2:50 AM by Simon Runc

# week spans two months, how to show one occurrence only?

Hi

my data has a date field, category and timing columns.  I want to show week names (Week 1, Week2,....) in each year/month.

my goal is to calculate "time left" which is basically (100 - timing column).  I have created a LOD expression to calculate the 'time left' column, because each week have 100 hours available, and i want to subtract the timing used from those 100 hours.

the results are accurate, but , Week 13 is showing twice (both in March and April 2017).  How can i show only one occurrence of Week 13 in this case ?

Thanks

• ###### 1. Re: week spans two months, how to show one occurrence only?

hi Simon Runc   Do you have any idea how this could be achieved please ?

• ###### 2. Re: week spans two months, how to show one occurrence only?

hmm....not sure!

So the reason for this is that Calendar Week 13 stretches across both the 30th March and 1st April dates in your data set

How would you want to handle this? Would you want a 2 day Week 13 for 30th - 31st March, and then Week 14 for 1st April? or some other way.

If you let me know I'll have a think about what's possible.

• ###### 3. Re: week spans two months, how to show one occurrence only?

Hi Simon

In my case, i would like to show Week 13 only once (as they have the same value of 'time left' because of the LOD i wrote) . So, showing Week 13 on March side and not showing it on April side.

This to be applied to any week that would span two months.

I hope this can be done somehow.

Thanks

• ###### 4. Re: week spans two months, how to show one occurrence only?

Hi Ammar,

Simply make a calc like this

DATETRUNC('week', [Incident Date])

and use it instead of [Incident Date] on a view.

Yours,

Yuri

1 of 1 people found this helpful
• ###### 5. Re: week spans two months, how to show one occurrence only?

Hi Yuri

i would like also to have the month name above the week number. when i do that, Tableau show Week 13 twice (in March and April).

Thanks

• ###### 6. Re: week spans two months, how to show one occurrence only?

Hi Ammar,

please try using this calculated pill twice on a view --

for both MY and Week granularity.

yours,

yuri

1 of 1 people found this helpful
• ###### 7. Re: week spans two months, how to show one occurrence only?

Nice Solution Yuri...very simple as always!

• ###### 8. Re: week spans two months, how to show one occurrence only?

I've thought you may be busy at the end of the day :-)

• ###### 9. Re: week spans two months, how to show one occurrence only?

As far as I can tell Simon Runc never sleeps!

--Shawn

• ###### 10. Re: week spans two months, how to show one occurrence only?

As far as I can tell Simon Runc never sleeps!

...I'm constantly in my own 24 hour Tableau party!!

I actually had a rare day off, and was supposed to be Tableau free...then I got this intriguing question, started to answer...then the wife puled rank, and has me on DIY duty for the rest of the day!!!