Instead of doing your if statement on the SLA% field, you will want to move the SLA logic into a new field, prior to the aggregation.
[SLA Last 7 Days] =
SUM(IF [Last 7 Days] THEN [Between Items in SLA] END)
SUM(IF [Last 7 Days] THEN [Total Items in SLA Backet] END)
1 of 1 people found this helpful
Derrick's reply might take care of it for you, but although you didn't state it in your problem statement, are you getting the error message that you can't mix aggregate and non-aggregates in your calc?
If that's what you are running into, here is how you get around it:
Instead of saying (for example)
[non-aggregate measure] + [aggregate calc]
ATTR([non-aggregate measure]) + [aggregate calc]
The ATTR function makes the individual measure look like an aggregate to Tableau, and you go on your merry way.
So ijn your case,
if attr([Last 7 Days]) =True then [SLA%] END
Yes, Joe is right - as long as you have that level of detail on the view that is a quick fix.
Mine is an alternative if you don't.
Hey guys, thanks for getting back to me, this was very helpful!
I followed your suggestion Derrick and it worked:
SUM( IF ([Pst Irt Sla Met]='Yes' and [Last 7 Days]=True) THEN 1 END)/
SUM(if(([Pst Irt Sla Met]='Yes' or [Pst Irt Sla Met]='No') and [Last 7 Days]=True) then 1 end) // it works with COUNT too
@Joe, I was getting indeed that error, sorry for incomplete problem. I will use the above for this scenario. Thanks!