10 Replies Latest reply on Jan 25, 2014 5:33 AM by Shawn Wallwork

    Case statement for stacked bar graph

    Greg Barnes

      Hi There,

       

      I am new to tableau and have difficulty with the statement below. I need to be able to count how many items there are of each within each range and then use that to create a stacked bar graph showing the percentage fr each category.

       

      This is the error message I receive: Syntax Error(Maybe your are missing and identifier)

       

      CASE [Items]

      WHEN <= 90 THEN 1

      WHEN > 90 AND <= 95 THEN 1

      WHEN > 95 AND <= 100 THEN 1

      WHEN > 100 AND <= 105 THEN 1

      WHEN > 105 AND <= 110 THEN 1

      WHEN > 110 AND <= 120 THEN 1

      ELSE 1

      END