Tableau Calculated Field  simpler way?
cignior Mar 9, 2016 8:20 AMI'm not a programmer by education... I'm more of a hobbyist. Is there a simpler way to code this in Tableau? There are way more iterations of my code than pasted into this post. But you get the idea:
IF [Product] = "PRODUCTA" AND [% Attainment] < 0.5 THEN 0 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "602020" AND [% Attainment] = 0.5 THEN 88 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "602020" AND [% Attainment] = 0.5 THEN 88 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "602020" AND [% Attainment] = 0.51 THEN 176 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "602020" AND [% Attainment] = 0.52 THEN 264 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "454015" AND [% Attainment] = 0.5 THEN 66 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "454015" AND [% Attainment] = 0.51 THEN 132 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "454015" AND [% Attainment] = 0.52 THEN 198 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "454015" AND [% Attainment] = 0.53 THEN 264 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "454015" AND [% Attainment] = 0.54 THEN 330 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "454015" AND [% Attainment] = 0.55 THEN 396 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "454015" AND [% Attainment] = 0.56 THEN 462 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "454015" AND [% Attainment] = 0.57 THEN 528 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "454015" AND [% Attainment] = 0.58 THEN 594 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "454015" AND [% Attainment] = 0.59 THEN 660 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "454015" AND [% Attainment] = 0.6 THEN 726 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "502525" AND [% Attainment] = 0.5 THEN 110 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "502525" AND [% Attainment] = 0.51 THEN 220 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "502525" AND [% Attainment] = 0.52 THEN 330 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "502525" AND [% Attainment] = 0.53 THEN 440 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "502525" AND [% Attainment] = 0.54 THEN 550 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "502525" AND [% Attainment] = 0.55 THEN 660 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "502525" AND [% Attainment] = 0.56 THEN 770 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "502525" AND [% Attainment] = 0.57 THEN 880 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "502525" AND [% Attainment] = 0.58 THEN 990 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "502525" AND [% Attainment] = 0.59 THEN 1100 ELSEIF [Product] = "PRODUCTA" AND [H2  Potential Tier Assignment Update] = "502525" AND [% Attainment] = 0.6 THEN 1210 END
UPDATE: Sorry. I added a picture to those that would like to look at prettier code. I didn't realize that pasting my code would create a jumbled mess (I even inserted it as "Raw HTML") But I'll leave it there for anyone who wants to mess with my code.

Capture.JPG 211.6 KB