3 Replies Latest reply on Sep 8, 2018 11:41 AM by Shinichiro Murakami

# Group distinct count by it's sum value

Hi,

I am having difficulties on doing grouping in Tableau.

I want to create a histogram to calculate the count distinct of drivers who receive the sum of complaints during the selected period.

I've tried loads of things but still can't figure this out.

My dataset looks like this:

What I want to make will look similar like this (inside chart and table). However, I still can't get the value in the table/chart right.

This chart group the distinct count of drivers who each have the same complaint value inside the bin.

The chart should only count the driver when their total sum of complaint during the selected period is equal to the bin size.

(i.e. for the period Jan-Mar '18,

Bin 0: 1 driver (A)

Bin 1 : 0 driver

Bin 2: 0 driver

Bin 3: 2 driver (B, C)

Bin 4: 0 driver

Bin 5: 1 driver (D)

I attached the file just in case.

Additionally, could you suggest me what I should learn to deepen my skills for this particular problem?

• ###### 1. Re: Group distinct count by it's sum value

Hi Anna,

Then to make LOD work properly, change the filter to context.

Filters and Level of Detail Expressions

There are bunch of free training materials on the site.

Top 15 Tableau LOD Expressions (Practical Examples)

Introduction to LOD Expressions

If this helped, please mark my answer as correct / helped to close the thread, not from inbox but from original post.

Thanks,

Shin

1 of 1 people found this helpful
• ###### 2. Re: Group distinct count by it's sum value

Thank you very much, Shin!

This works wonders!

Could you elaborate on why this works on my question when I aggregate it, but when I split it by period it's not correct?

I'm still having difficulties understanding LOD expressions.

Thanks again!

• ###### 3. Re: Group distinct count by it's sum value

why this works on my question when I aggregate it, but when I split it by period it's not correct?

==> Because the function of LOD itself is to disregard the dimension in the view and add own dimension which is in the LOD expression .

Thanks,

Shin