4 Replies Latest reply on Sep 22, 2016 12:19 PM by Liliya Fisher

    Help with formula

    Liliya Fisher

      Hello,

      for some reason i'm getting a calculation error message. Could someone please help me to identify what is wrong with the formula? I also noticed that in some cases [Business group] is highlighted in red and in some cases in black. I thought it was because I wrote the formula in word and pasted in Tableau and when i tried to drag [Business group] from the menu to replace the ones in black it did not let me drag it to replace the ones in black. I also included a picture attachment. Thank you

      If [Business group] = 'Ultrasound' then 'Grant, Bruce'

      ELSEIF [Business group] = 'HS Informatics, Solutions & Services' then 'Vriesema, Gwen'

      ELSEIF [Business group] ='Patient Care & Monitoring Solutions' then 'Laurino, Paul'

      ELSEIF [Business group] ='Sleep & Respiratory Care' then 'Mitchell, Sheila'

      ELSEIF [Business group] ='Image Guided Therapy' then 'Bowden, Christine'

      ELSEIF [Business group] ='Diagnostic Imaging' then 'Morales Olivera, Fernando'

      ELSEIF [Business group] ='Service' or [Business group] = 'Remaining TV' or [Business group]= 'Licenses’ or [Business group]= 'Lifestyle Entertainment' or [Business group]= 'TV' then 'Leblanc, Lynne'

      ELSEIF [Business group] ='Domestic Appliances' then 'Zhou, Ruby'

      ELSEIF [Business group] ='Personal Care' then 'Hos, Aniek'

      ELSEIF [Business group] = 'Health & Wellness' then 'Hesen, Geerte'

      ELSEIF [Business group] ='Coffee' then 'Hesen, Geerte'

      ELSEIF [Business group] ='Market NA' then 'Johnson, Todd'

      Else ‘Guest’

      END

        • 1. Re: Help with formula
          David Li

          Hi Liliya! I'm not exactly sure what's causing this issue, but you might be able to fix it by switching to CASE...WHEN instead of a bunch of ELSEIFs.

          CASE [Business group]

               WHEN 'Ultrasound' then 'Grant, Bruce'

               WHEN 'HS Informatics, Solutions & Services' then 'Vriesema, Gwen'

               WHEN 'Patient Care & Monitoring Solutions' then 'Laurino, Paul'

               WHEN 'Sleep & Respiratory Care' then 'Mitchell, Sheila'

               WHEN 'Image Guided Therapy' then 'Bowden, Christine'

               WHEN 'Diagnostic Imaging' then 'Morales Olivera, Fernando'

               WHEN 'Service' then 'Leblanc, Lynne'

               WHEN 'Remaining TV' then 'Leblanc, Lynne'

               WHEN 'Licenses' then 'Leblanc, Lynne'

               WHEN 'Lifestyle Entertainment' then 'Leblanc, Lynne'

               WHEN 'TV' then 'Leblanc, Lynne'

               WHEN 'Domestic Appliances' then 'Zhou, Ruby'

               WHEN 'Personal Care' then 'Hos, Aniek'

               WHEN 'Health & Wellness' then 'Hesen, Geerte'

               WHEN 'Coffee' then 'Hesen, Geerte'

               Else 'Guest'

          END

          EDIT: Now that I look at it closer, you might have some of Word's fancy quotation marks instead of the basic ones Tableau uses in there. I'm not sure if that caused the issue, but it might. Next time, I'd recommend using Tableau's built-in editor instead of Word to build your formula.

          • 2. Re: Help with formula
            Liliya Fisher

            Thank you for the response but the issue is that 'Leblanc Lynn' is responsible for several Business groups. I use this formula to control user access so when Lynn logs in she can only see business groups she is responsible for. I had when formula but it did not work, resulted in Blank result on the dashboard and i know it should not be. I included the view shot as an attachment. Thank you.

            • 3. Re: Help with formula
              David Li

              Hi Liliya, it seems like manual user filters would be a lot easier to implement here. Have you looked at this? User Filters and Row Level Security | Tableau Software

               

              Also, note that you can paste images directly from your clipboard into this forum's reply/edit window. You don't need to save them into a Word document.

              • 4. Re: Help with formula
                Liliya Fisher

                ok, thank you, i will look into this.

                Liliya