
1. Re: Help in formula  If match primary condition and secondary one then xx
Hima vardhan Reddy Pavuluri Nov 11, 2016 2:19 AM (in response to Morgan DUARTE)Hi Check this :
Create 2 calculations like below :
z :
CASE [Act]
WHEN 'Act1' THEN (IF [Actual]>=[Target] THEN 1 END)
WHEN 'Act2' THEN (IF [Actual]>=[Target] THEN 2 END)
WHEN 'Act3' THEN (IF [Actual]>=[Target] THEN 3 END)
END
Result :
IF MIN([z])=1 THEN (IF MEDIAN([z])=2 THEN 5 ELSEIF MAX([z])=2 THEN 2 ELSEIF MAX([z])=3 THEN 3 END)
ELSE 0
END
attaching sample workbook :

sample4.twbx 16.3 KB


2. Re: Help in formula  If match primary condition and secondary one then xx
Morgan DUARTE Nov 11, 2016 2:29 AM (in response to Hima vardhan Reddy Pavuluri)Very interesting solution ! Thank you Hima,
What if I have 4 activities?
Act4 = Target 50, Actual 60
If the targets for Act1 and Act4 are met, we got 5% incentive.
So if all met, it will be 10%
In that case the medium will not work, right.
Any other way in that case?
Thank you !

3. Re: Help in formula  If match primary condition and secondary one then xx
Hima vardhan Reddy Pavuluri Nov 11, 2016 2:39 AM (in response to Morgan DUARTE)Yes Median will not work in that case : Try these calculation (just changing old calculations) :
z :
CASE [Act]
WHEN 'Act1' THEN (IF [Actual]>=[Target] THEN 1 END)
WHEN 'Act2' THEN (IF [Actual]>=[Target] THEN 2 END)
WHEN 'Act3' THEN (IF [Actual]>=[Target] THEN 3 END)
WHEN 'Act4' THEN (IF [Actual]>=[Target] THEN 4 END)
END
Result :
IF ({ FIXED : MIN([z])})=1 THEN (IF [z]=2 THEN 2 ELSEIF [z]=3 THEN 3 ELSEIF [z]=4 THEN 4 ELSE 0 END)
ELSE 0
END

4. Re: Help in formula  If match primary condition and secondary one then xx
Morgan DUARTE Nov 13, 2016 11:26 PM (in response to Hima vardhan Reddy Pavuluri)Thanks a lot for your help.
Attach is the exact data I have.
As the data is coming from 2 different sources, I have to aggregate the value and then the result does not work anymore.
Any idea on how to do it?
Thanks
Tableau  Incentive.twbx 18.5 KB
