1 of 1 people found this helpful
Jonathon, you've created a Table Calculation, which will be affected by any/all dimensions you put in the viz. On top of that, you've created a calculation that only looks at the FIRST() row(column) so Tableau is only going to return one value because that's what you told T you wanted.
Post a packaged workbook with some sample data, and a bit more info on what you are trying to accomplish, and we'll be better able to help you.
Looking at your calculation, it was hard to tell what is going on. I suspect that is causing as much trouble for you as it is for us. When I need to make something complex like this, I try to break it into manageable pieces. I see the temptation of dumping things all into one calc, and sometimes it works fine (maybe), but when it doesn't work as expected you're in trouble.
I took a crack at breaking yours down, to see if I could at least figure out your intention. I think I mostly understand.
When "1" then 1
When "2" then 2
When "3" then 3
Hours to Start Treatment:
Target Met Indicator:
Case [Priority Number]
when 1 then (if [Hours to Assign] <= [Emergency Response Target] then 1 else 0 end)
when 2 then (if [Hours to Assign] <= [Critical Response Target] then 1 else 0 end)
when 3 then (if [Hours to Assign] <= [Non-Critical Response Target] then 1 else 0 end)
Percentage Meeting Target:
Sum([Target Met Indicator]))/Sum(1)
This could be shown as a time series, and I think may be what you're looking for (possible the denominator should be count([ow]), though it is hard to say without looking at your data). Window_Sum rolls your data up to a higher level than the full granulatity of the viz, so if this happens across date it wouldn't be very interesting time series to look at as all values would be the same. For this reason there are situations where the result of such a calc are supressed for all but one record, using something like first()==0 or last()==0 is common, the choice of record is typically arbitrary in such cases.
Does that help?
This appears to be working as intended. Thank you for the assistance and insight.
Great! Glad I could help.