8 Replies Latest reply on Nov 30, 2018 1:03 PM by Ken Flerlage

# Requesting help with Histogram

I am struggling to get my histogram correct. The dimension titled "Reference" is the unique ID of the dataset. This unique ID can be recorded in multiple dates. I am wondering if I am needing to fix this variable somehow to count each instance of variance to get my count on variance in each bin. Please advise.

• ###### 1. Re: Requesting help with Histogram

A histogram counts the number of occurrences of each bin. So, instead of having SUM(Variance) on the Rows shelf, change this to SUM(Number of Records).

You have a wide range of variances, so I fixed the axis to -1 to 1 so you can see it a bit better, but you should end up with something like this:

• ###### 2. Re: Requesting help with Histogram

This does not create the correct result.

• ###### 3. Re: Requesting help with Histogram

What is the expected result?

• ###### 4. Re: Requesting help with Histogram

Are you trying to first aggregate based on Reference, then do a histogram? If so, what kind of aggregation do you want? SUM, AVG, etc.?

Let's say that the above is true and you want to aggregate by average variance. To do this, we'd need to first aggregate the variance, then create bins on that aggregate. Unfortunately, you can't create bins on an aggregate field in Tableau, so we can sort of trick Tableau using LODs:

Avg Variance

{FIXED [Refrence]: AVG([Variance])}

We can then create bins on this field.

Next we'll want to count the unique number of References for each of those bins. To do that, you can use a count distinct of Reference. Here's an example using a bin size of 0.5:

See attached.

• ###### 5. Re: Requesting help with Histogram

This is not quite right either. I have 1,201 data points. Dimension="Reference" can be repeated for example see below. My understanding is the histogram will be correct when we see 1,201 data points in binned. Also my variances are between -97.53 and +152.72 the example given above trying to solution this does not prove out either of these factors? Any other suggestions? Your help is greatly appreciated

 Date Reference Variance 1/31/2015 ABC 123 -10.59 2/28/2015 ABC 123 10.59 3/31/2018 ABC 123 0 4/30/2015 ABC 123 0 5/31/2015 ABC 123 0 6/30/2015 ABC 123 0 7/31/2015 ABC 123 0 8/31/2015 ABC 123 0 9/30/2015 ABC 123 0
• ###### 6. Re: Requesting help with Histogram

What do you mean when you say you have 1,201 data points? The data has a total of 16,018 records and there are 428 unique References. What is your definition of a data point?

• ###### 7. Re: Requesting help with Histogram

I am sorry I meant 16,018 I would expect that many data points. I would expect X number of bins @ 0.05 parameter and the sum of the counts in each bins to equal 16018. Does that make sense?

• ###### 8. Re: Requesting help with Histogram

Yes, the first option I showed you should have given you that. The 0 bin had 13,736 records and the remaining 2000 or so were spread amongst all the other bins, so it looks really skinny in the middle and appears to have no other data on the left and right.