4 Replies Latest reply on Sep 12, 2018 5:12 AM by totolo

# Combine two months together on a series of monthly data

Hello everyone,

I would like to combine two months together in a visualization.

Indeed the months of July and August are the months of the holidays and I would like not to have July on one side and August on the other.

Ideally I would like to have just one item which will aggregate the data for the two months called  "July-August".

I tried different techniques without sucess because I lose the date logic:

If month([Date]) <=1 then  'Janvier'

ELSEIF

month([Date]) <=2 then  'Février'

ELSEIF

month([Date]) <=3 then  'Mars'

ELSEIF

month([Date]) <=4 then  'Avril'

ELSEIF

month([Date]) <=5 then  'Mai'

ELSEIF

month([Date]) <=6 then  'Juin'

ELSEIF

month([Date]) <=7 then  'Juillet'

ELSEIF

month([Date]) <=8 then  'Août'

ELSEIF

month([Date]) <=9 then  'Septembre'

ELSEIF

month([Date]) <=10 then  'Octobre'

ELSEIF

month([Date]) <=11 then  'Novembre'

ELSEIF

month([Date]) <=12 then  'Décembre'

END

I'm a stuck I've been through the forum and I find myself without a solution. I don't know if that's possible.

Best regards.

Totolo

• ###### 1. Re: Combine two months together on a series of monthly data

Hi Totolo,

Like This?

You need to Self Union Your Dat and Write this Calc and Sort Manully to get above:

This is the Calc:

Thnaks

Deepak

If it Helps, pl mark it Helpful and CORRECT to close Thread

1 of 1 people found this helpful
• ###### 2. Re: Combine two months together on a series of monthly data

you can avoid the union if you hack up a modified Sales measure that combines July and August.  See SalesModified in this example.

However you'll need to make the Months pill discrete to chop out July. (Continuous will put that empty month on the sheet all the same.)   Also I put SalesModified on filters to exclude NULLs.
1 of 1 people found this helpful
• ###### 3. Re: Combine two months together on a series of monthly data

Another approach would be to build your own hierarchy and make your own month name and shove all July and August data into that new month.  You'd have only 11 "months" in that hierarchy.  (Grab Year from the original date, and put them together as a hierarchy.)

You would lose the nice date features that Tableau gives you, of course, but it would expand and contract like any other date hierarchy.

1 of 1 people found this helpful
• ###### 4. Re: Combine two months together on a series of monthly data

Hello Joshua,

Thank you very much this solution works perfectly.

it's impossible to bring a custom name for the month of August ? That would be very practical !

thanks for all the solutions proposed for this problem it allows me to better understand how the dates in the table work.