title: Case statement in Tableau calculated field
body: <p>I am trying to get functionality as shown in the below SQL code: </p>
  
  <pre><code>select ....... , A.authorizedAction
  , '1 - Add' = Case when (Cast((authorizedAction / 1) As Int) % 2) = 1 then 'Y' end
  , '2 - Update/Display' = case when (Cast((authorizedAction / 2) As Int) % 2) = 1 then 'Y' end
  , '4 - Update/Display all' = case when (Cast((authorizedAction / 4) As Int) % 2) = 1 then 'Y' end 
  , '8 - Correction' = case when (Cast((authorizedAction / 8) As Int) % 2) = 1 then 'Y' end 
  , A.authorizationActionKey   .... from ....
  </code></pre>
  
  <p>I want to represent all the 4 cases (Add, update/Display, Update/Display All and Correction) as column values for a worksheet in tableau. </p>
  
  <p>I found 'case' statement is a valid function in tableau but am not sure if i can get this kind of a functionality. Basically I am only given 'authorizedAction' and I need to create one calculated field for the 4 cases above. Can I somehow group these case statements into one calculated field formula?</p>
  
  <p>Any help is appreciated. If you can provide me a calculated field formula that works, nothing like it!</p>