6 Replies Latest reply on Dec 7, 2017 3:26 PM by David Maning

# Groupping values by quarter, half year and year

Hi guys!!!

Would you be so kind to help me with solving the following issue:

I need to create parameter that will groupe my values by months, quaters, half years and years.

I managed with month case in the following may: I create two parameters (Start_Date & End_Date). Then I create a calculated field that output my results in the limits of sated parameters. Everytrhing works well.

However such trick is not working with quaters, half years and years and I am quite confused how to solve it.

Case is urgent! Count on your help!

• ###### 1. Re: Groupping values by quarter, half year and year

Hi Dimitriy

You have a lot of complicated setting , then I am not sure I ma messing up your work or not, but for sure some simplification should be done.

Regards,

Shin

1 of 1 people found this helpful
• ###### 2. Re: Groupping values by quarter, half year and year

Hi Shin,

Thank you a lot for your comprehensive response!!!

I have slightly changed you "selected period" dimension due to the fact that there were some troubles with date field. Tableau sees it as an empty field. Probably this is an error, which occurred due to downloading or smth else.  Anyway everything is perfect and aggregate values in a right way. I've cleaned and updated file as attached. =)

Would you be so kind clarify one more thing: is it possible to automatically change the format of header when you change the period group? For example, on quarter format, year format and etc?^^

All the best,

Dimitriy

• ###### 3. Re: Groupping values by quarter, half year and year

That is not an option.

You can change the display format only in case you use "string value" as header.

However string value header brings other much more difficult factor to handle and I don't recommend it.

Regards,

Shin

• ###### 4. Re: Groupping values by quarter, half year and year

Hi Shin,

Would you be so kind to clarify how the formula regarding half year works? Especially the calculation "/6-1)*6+1"

Dimitriy

• ###### 5. Re: Groupping values by quarter, half year and year
 month([date]) month([date])-1 (month([date])-1)/6 int((month([date])-1)/6) int((month([date])-1)/6)*6 int((month([date])-1)/6)*6+1 1 0 0 0 0 1 2 1 0.166666667 0 0 1 3 2 0.333333333 0 0 1 4 3 0.5 0 0 1 5 4 0.666666667 0 0 1 6 5 0.833333333 0 0 1 7 6 1 1 6 7 8 7 1.166666667 1 6 7 9 8 1.333333333 1 6 7 10 9 1.5 1 6 7 11 10 1.666666667 1 6 7 12 11 1.833333333 1 6 7
• ###### 6. Re: Groupping values by quarter, half year and year

Thank you!

I was trying to following all your steps once again (updated this topic with new worksheet) and I'd like to ask you can you please clarify the following:

1) Can you please explain the meaning of Measure_Text and Rank_title and the way of their computing?

2) Is there any possibility to apply name of brand and its value to card? For example (in case of Top 5 scenario):

Brand 1 10m

Brand 2 8m

Brand 3 6m

Brand 4 4m

Brand 5 2m

Other 1m