11 Replies Latest reply on Jan 11, 2017 7:15 AM by Kashish Chauhan

    LOOKUP in Tableau?

    J Workman

      I need your best and brightest, I have this problem which has been plaguing me for a long time. I have attached a simple packaged workbook. Here's what I need it to do. I have a calculated field titled CommFlag which looks at the Category field, and populates the field with a 1 or 0 based on whether the Category field contains the string "comm." If it contains the string, the account is Commercial (1), if not, then 0.

       

      What I need to do is amend the formula in the calculated CommFlagRelated field, to generate a 1 or 0, but base it upon the Masked SSN field. You'll notice that some of these rows in the Masked Account Number field shared a Masked SSN in common. The idea is that the CommFlagRelated field should generate a 1 for any row which shares a Masked SSN with another row for which the CommFlag is 1. So, it's like a Lookup function from excel, which looks up the Masked SSN and returns a 1 in the CommFlagRelated field if that SSN has CommFlag of 1 in any of its rows. Is this a possibility at all in Tableau?

       

      I thought maybe I was on the right track with the following link (Breaking BI: Using the LOOKUP() function in Tableau ), but it isn't accomplishing what I want it to. Does anyone have any other ideas to make this happen, by creating a custom field either in the Data Source tab or in the Worksheet tab?