3 Replies Latest reply on Aug 24, 2016 7:52 AM by Luciano Vasconcelos

    Elseif statement

    Ethan Elliott

      So I have a data set that is raw data for different groups within my company, OT hours used, OT costs, and it also lists the HR Group that these OT hours are billed to.

       

      I have made something that is a visual of YTD OT Earnings per HR Group Name. What I'd like to do is create an Elseif statement that says if a group has spent more than X amount of dollars on OT then Tableau will group them into a different category of needing to hire more people.

       

      When I write the Elseif statement it writes it at the raw data level though and looks at each employee and not the HR Div Name. So it groups based on the amount of YTD OT Earnings per employee. I am looking for it to split by HR Div Name as I've shown in my visual. YTD OT Earnings in my raw data is broken down by employee in the column in my excel doc. My visual in Tableau is just Sum(YTD OT Earning) in Rows and HR DIV NAME in columns. Please let me know if more info is needed.

       

      This is what I'm writing

       

      IF  [YTD OT Earning]> $200000 THEN "Hire more people" ELSE "Do not hire more people" END

       

      It's quite simple, and i think I'm just approaching it wrong. I'm very new to Tableau.