1
votes

I have 20 lists of servers. Suppose we have 50 servers and everyday (for 20 days) we get a list of active servers. Having this list, I want to calculate the number of times each server has appeared in the lists. Suppose that Server1 has appeared in 16 out of these 20 lists. Here's how I'm doing it:

  1. new calculated field: {FIXED [Server]:COUNT([Server])}
  2. move this calculated field to columns
  3. calculate CNTD (count distinct) and put it in rows

here's the results: enter image description here Now here comes the question: What if I want to draw the very same chart, but only according to the last 5 lists (lists we've got the last 5 days)? If I filter based on paths and take the last 5 lists, the numbers calculated in calculated fields won't update. they're gonna still be 6,8,...16 while there are only 5 lists (the maximum number of appearance should be 5). Any ideas?

1

1 Answers

1
votes

Instead of using the FIXED level-of-detail (LOD), use INCLUDE. The order of operations for LOD calculations will run FIXED calculations run before applying any filtering. INCLUDE/EXCLUDE are applied after filtering.

{INCLUDE [Server]:COUNT([Server])}

This image from the online help shows the order of operations for LOD calculations and filtering.

enter image description here

See https://onlinehelp.tableau.com/current/pro/desktop/en-us/calculations_calculatedfields_lod_overview.html for more details.