Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Can you please suggest , how to remove nested if else in below script.
if(GetSelectedCount(AREA)<>1 and GetSelectedCount(Entity)<>1 and GetSelectedCount(Company)<>1 and GetSelectedCount(Region_Prototype)<>1 and GetSelectedCount([Sub Region])<>1 and
GetSelectedCount(BranchOfficeDesc)<>1 and GetSelectedCount(LOBDescription)<>1 and GetSelectedCount(CustNo)<>1,'AREA',
If
(GetSelectedCount(AREA)>0 and GetSelectedCount(Entity)<>1 and GetSelectedCount(Company)<>1
and GetSelectedCount(Region_Prototype)<>1 and GetSelectedCount([Sub Region])<>1 and
GetSelectedCount(BranchOfficeDesc)<>1 and GetSelectedCount(LOBDescription)<>1 and
GetSelectedCount(CustNo)<>1,'Entity',
If(
GetSelectedCount(Entity)>0 and GetSelectedCount(Company)<>1 and GetSelectedCount(Region_Prototype)<>1 and GetSelectedCount([Sub Region])<>1 and
GetSelectedCount(BranchOfficeDesc)<>1 and GetSelectedCount(LOBDescription)<>1 and GetSelectedCount(CustNo)<>1,'Company',
If(GetSelectedCount(Company)>0 and GetSelectedCount(Region_Prototype)<>1 and
GetSelectedCount([Sub Region])<>1 and GetSelectedCount(BranchOfficeDesc)<>1 and GetSelectedCount(LOBDescription)<>1 and GetSelectedCount(CustNo)<>1,'Region_Prototype',
if(GetSelectedCount(Region_Prototype)>0 and GetSelectedCount([Sub Region])<>1 and GetSelectedCount(BranchOfficeDesc)<>1 and
GetSelectedCount(LOBDescription)<>1 and GetSelectedCount(CustNo)<>1,'[Sub Region]',
if(
GetSelectedCount([Sub Region])>0 and GetSelectedCount(BranchOfficeDesc)<>1 and
GetSelectedCount(LOBDescription)<>1 and GetSelectedCount(CustNo)<>1,'BranchOfficeDesc',
If(GetSelectedCount(BranchOfficeDesc)>0,'CustNo',
if(GetSelectedCount(Entity)<>1 and GetSelectedCount(Company)<>1
and GetSelectedCount(Region_Prototype)<>1 and GetSelectedCount([Sub Region])<>1 and
GetSelectedCount(BranchOfficeDesc)<>1 and GetSelectedCount(LOBDescription)<>1 and
GetSelectedCount(CustNo)<>1,'Entity',
if(GetSelectedCount(Region_Prototype)<>1 and
GetSelectedCount([Sub Region])<>1 and GetSelectedCount(BranchOfficeDesc)<>1 and GetSelectedCount(LOBDescription)<>1 and GetSelectedCount(CustNo)<>1,'Region_Prototype',
if(GetSelectedCount([Sub Region])<>1 and GetSelectedCount(BranchOfficeDesc)<>1 and
GetSelectedCount(LOBDescription)<>1 and GetSelectedCount(CustNo)<>1,'[Sub Region]',
if(GetSelectedCount(BranchOfficeDesc)<>1 and
GetSelectedCount(LOBDescription)<>1 and GetSelectedCount(CustNo)<>1,'BranchOfficeDesc','CustNo'
)
)
)
)
)
)
)
)
)
)
)
Thanks
I am explaining about one part
Create one variable for this
GetSelectedCount(AREA)<>1 and GetSelectedCount(Entity)<>1 and GetSelectedCount(Company)<>1 and GetSelectedCount(Region_Prototype)<>1 and GetSelectedCount([Sub Region])<>1 and
GetSelectedCount(BranchOfficeDesc)<>1 and GetSelectedCount(LOBDescription)<>1 and GetSelectedCount(CustNo)<>1
And then Use Same variable into Qlikview in variable overview (Ctrl + Alt + V)
1) create 10 variables for each and every statement
2) Then use Pick Match condition like, I am 100% sure here, If condition kills the performance rather than Pick & Match combination
Pick(Match($(Var1), $(Var2), $(Var3), $(Var4), $(Var5), $(Var6), $(Var7), $(Var8), $(Var9), $(Var10)), 'Area', 'Entity', 'Company', 'Region_Prototype', 'Sub Region', 'CustNo', 'Entity', 'Region_Prototype', 'Sub Region', 'CustNo')