3 Replies Latest reply on Jun 14, 2017 3:51 AM by Yuriy Fal

# Custom Grouping of Dimension - not Date type

Hi,

I need to create custom groupings on a dimension which is not a time/date based value.

In a similar manner that time/date can be grouped into week or month or quarter, I have noise and vibration data which is frequency based (1 to several thousand Hz) and I want to create custom groups to aggregate the measures against.  For example, I may want to average the noise level in 50Hz bands from 0 to 2000Hz, or in 1/3 Octave bands, or I might just want to leave the data in it's original form and look at a line plot across the full frequency range.

Can anyone explain how I could go about this, I've looked around the forums etc but can't quite find what I'm looking for.

See attached workbook for some sample data.

• ###### 1. Re: Custom Grouping of Dimension - not Date type

Hi Martin,

Are you looking for 50Hz "bands" (Bins in Tableau language)

as a granularity of your [X Values] Dimension on a view?

If yes, then you can calculate them from your [X Values] Dim.

Hope it helps.

Yours,

Yuri

• ###### 2. Re: Custom Grouping of Dimension - not Date type

Yuriy,

Thanks for that,  I'd sort of figured that evenly spaced bins was an option.  What about uneven / non-linear spaced bins?

Martin

• ###### 3. Re: Custom Grouping of Dimension - not Date type

Hi Martin,

Uneven bins could be calculated manually -- using a set of

IF ... THEN ... ELSEIF ... THEN ... ELSE ... END statements, like the below:

// Custom Bins

IF ISNULL([Sales]) THEN '0'

ELSEIF [Sales] < 10 THEN '0.01-9.99'

ELSEIF [Sales] < 100 THEN '10-99.99'

ELSE '100 and above'

END

Non-linear (power law) bins could be calculated like the below:

// Bins (Power of 10)

10^( INT( LOG([Sales],10) ) )

// Bins (Power of e -- natural log)

EXP( INT( LN([Sales]) ) )

Hope this could help.

Yours,

Yuri