Deuce8_2016
Deuce8_2016

Reputation: 9

LOD (Level Of Detail) where Year =

Trying to write a Calculation in Tableau that allows me to Fix Level of Detail on Category where year equal a designated date.

Imagine looks something like

{FIXED [REPORT CATEGORY] : AVG(DOLLARS PAID)} WHERE YEAR = 2015

Upvotes: 0

Views: 502

Answers (1)

Nick
Nick

Reputation: 7451

You have a couple of options.

1) You add the YEAR dimension to the LOD calculation and then add the Year to the filter card and set to '2015'. Your calculation would look like this:

Since you have no YEAR, you need to create a calculated field for it then reference it.

"YEAR" : YEAR(APCD PAID ACCNTS DATE)

{ FIXED [REPORT CATEGORY], [YEAR]: AVG(DOLLARS PAID) }

2) You can restrict the aggregation to only a specific year in the calculation, like so:

{ FIXED [REPORT CATEGORY]: AVG(IF YEAR([APCD PAID ACCNTS DATE]) = 2015 THEN DOLLARS PAID END) }

-- EDIT --

Updated above because you stated you are using a DATE not a number of the year.

Upvotes: 1

Related Questions