Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Below is the condition used in my code
if(ApplyMap('WBS_Des_MAP',[WBS Element],0)<>0, [WBS Element],
if(len(trim(Assignment))>6,if(ApplyMap('WBS_Des_MAP',Assignment,0)<>0,Assignment,
if(len(trim(H.Text))<>0, H.Text,
if(ApplyMap('WBS_Des_MAP',[Project Code],0)<>0,[Project Code]
)))))
as WBS_Final_Code
As per my Understanding "If there is any mapping with WBS_Des_MAP then it will choose [WBS Element] from this table else it will check for next statement" Similarly for other statements. Please correct me if i am wrong.
But i don't know why the above condition is failing. It just checks at first statement is mapping is available then [WBS Element] else it results empty.
Please help me with this.
Regards,
Keerthi KS
Hi Jonathan,
I understood the mistake.
if(ApplyMap('WBS_Des_MAP',[WBS Element],0)<>0
,[WBS Element]
,
//
if(len(trim(Assignment))>6 and ApplyMap('WBS_Des_MAP',Assignment,0)<>0
,Assignment
,
if(len(trim(H.Text))<>0
,H.Text
,
if(ApplyMap('WBS_Des_MAP',[Project Code],0)<>0
,[Project Code]
))))
Thanks,
Keerthi KS
Hi,
Your first applymap itself is with both true and false condition.
if(ApplyMap('WBS_Des_MAP',[WBS Element],0)<>0, [WBS Element]
here if [WBS Element] <>0 ,[WBS Element]
else 0
so this first condition will always execute for a true/false value.
so "If there is any mapping with WBS_Des_MAP then it will choose [WBS Element] from this table else it will return 0".
Hope it helps!
Kiruthi
Two of the Ifs do not have else conditions (highlighted in bold below), so if the condition is false, the statement will return null. Re-arranged for clarity:
if(ApplyMap('WBS_Des_MAP',[WBS Element],0)<>0,
[WBS Element],
if(len(trim(Assignment))>6,
if(ApplyMap('WBS_Des_MAP',Assignment,0)<>0,
Assignment,
if(len(trim(H.Text))<>0,
H.Text,
if(ApplyMap('WBS_Des_MAP',[Project Code],0)<>0,
[Project Code]
)
)
)
)
) as WBS_Final_Code
Hi Jonathan,
I understood the mistake.
if(ApplyMap('WBS_Des_MAP',[WBS Element],0)<>0
,[WBS Element]
,
//
if(len(trim(Assignment))>6 and ApplyMap('WBS_Des_MAP',Assignment,0)<>0
,Assignment
,
if(len(trim(H.Text))<>0
,H.Text
,
if(ApplyMap('WBS_Des_MAP',[Project Code],0)<>0
,[Project Code]
))))
Thanks,
Keerthi KS