1
votes

I have a bar chart with X axis as discrete date value and Y axis as number of records. eg: x axis (Filtered Date)- 1st Oct, 2nd Oct, 3rd Oct etc y axis (Number of Records)- 30, 4, 3 etc

Now, I have to create a table to get Max, Min and Avg. Value of the 'Number of Record'.

I have written a Calculated Field as MAX([Number of Records]) to get the maximum of Number of Records in this case 30 but I always get a value of 1.

How do I define the values to get max, min and avg. ?

Thanks,

1

1 Answers

1
votes

Number of Records is an automatically calculated field that tableau generates when importing a datasource. You can right click on it and see the definition of the calculation: 1.

As you currently have your field defined, tableau will look for the maximum value of the column. It will always be 1 because that is the only value in that field for every record.

It sounds like you are actually trying to calculate the maxiuum of the sum of the number of records for your aggregation level (in your case date). You should be able to easily accomplish this using Level of Detail (LOD) expressions, or table calculations. Something like the following:

WINDOW_MAX(SUM([Number of Records]))