Hi @Bhawna Singh,
I totally second what @Tony Wong says about the performance impacts of nested IF statements esp. with lookups inside.
This kind of a "Order of Preference" lookup is a pattern I use a lot. Sometimes you may have multiple levels of lookup Here is how I do it:
Have your lookups in separate columns with good descriptive names like so:
LookupEmailwDomain = Lookup(Box Email Domain,HW Email Domain Reference List,Email Domain,Business Unit,false,false,true)
LookupEmailwoDomain = Lookup(Box email without no domain,HW ADMP Report,ADMP Email without Domain,Final BU,false,false,true)
LookupADUsername = THIS IS A FAKE THIRD function for the purpose of this example.
LookupXXUsername = THIS IS A FAKE FOURTH function for the purpose of this example.
Assuming you are trying to create a column name Business Unit, here is the pattern
Business Unit = if(LookupEmailwoDomain="",Business Unit Stage 1,LookupEmailwoDomain)
Business Unit Stage 1 = if(LookupEmailwDomain="",Business Unit Stage 2,LookupEmailwDomain)
Business Unit Stage 2 = if(LookupADUsername="",Business Unit Stage 3,LookupADUsername)
Business Unit Stage 3 = LookupXXUsername
:
:
and so on.
So the lookups are calculated first and the first non blank value is taken in the order of preference:
Business Unit
Business Unit Stage 1
Business Units Stage 2
Business Unit Stage 3
and so on.
I think I will christen this the "Order of Preference" Lookup Pattern.
Hope this helps.
Regards,
Sanjay Valiyaveettil