Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to optimize nested if function so I am trying pick and match function.
need to convert below expression:
if
(
Current_Level = 5,
'P(District_Hierarchy_S_Name)',
if
(
Current_Level = 3,
'P(Region_Hierarchy_S_Name)',
if
(
Current_Level = 2,
'P(OEM_Hierarchy_S_Name)',
'P(OEM_Hierarchy_S_Name)'
)
)
)
I tried this: Pick(Match(Current_Level, 5,3)+1, OEM_Hierarchy_S_Name, District_Hierarchy_S_Name, Region_Hierarchy_S_Name)
Can anyone help me with this???
@shivam0703 I just referred your original expression where you have condition for level=2 and you also used quotes in so I thought you already using it in same . If you don't want that way try below
Pick(Match(Current_Level, 5,3)+1,
OEM_Hierarchy_S_Name,
District_Hierarchy_S_Name,
Region_Hierarchy_S_Name)
@shivam0703 try below
Pick(Match(Current_Level, 5,3,2)+1,
'P(OEM_Hierarchy_S_Name)',
'P(District_Hierarchy_S_Name)',
'P(Region_Hierarchy_S_Name)',
'P(OEM_Hierarchy_S_Name)')
@Kushal_Chawda why are you adding 2 and its condition because for cureent_level =2 or any other apart from 3 and 5 it gives same as P(OEM_Hierarchy_S_Name) so no need to add 2 and one more doubt if I use in single quote then it will take it as a string an but I have a filed name 'P(District_Hierarchy_S_Name)',
here District_Hierarchy_S_Name is a field name bt if u use inside ' ' then it will take as a string
@shivam0703 I just referred your original expression where you have condition for level=2 and you also used quotes in so I thought you already using it in same . If you don't want that way try below
Pick(Match(Current_Level, 5,3)+1,
OEM_Hierarchy_S_Name,
District_Hierarchy_S_Name,
Region_Hierarchy_S_Name)