forums

Use these forums to ask questions and discuss Tableau.

Calculations using ad-hoc group

I created an "ad-hoc group". I was hoping to use this group in a calculation, but that does not appear to be possible. Is that true?

For example, say I have a field named "State". I create an ad-hoc group called "Region" based off that field. So I want to create a calculated field that would do something like...

If [Region] = 'West' then...

By the way, it would not be realistic to calculate using "State" directly, because in this case there are way too many options to list out in a calculation.

Comments

Unfortunately, no you cannot use an adhoc group in a calculation. Both adhoc groups and numeric bins use special formatting to display the results of the calculation. This is done in Tableau and isn't available to the database engine, so the value to check for in the calculation is very mysterious and hard to figure out.
A workaround is to create your own 'ad-hoc group' calculation using a CASE statement. Then, use that column in a calculation. This is more cumbersome, but you'll have complete control over the result values so it will be easy to write other calculations based on it.

:)ross

Syndicate content Subscribe to the comments on "Calculations using ad-hoc group"