Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
pandreozzi
Creator
Creator

Expression Help

I have an expression that I need to add another condition to that I need help with. Below is the current expression where the syntax is correct.

=if(IsNull([Record Type]),if(ASSET_CLASS='Router' or ASSET_CLASS='Data Switch' or ASSET_CLASS='Firewall' or ASSET_CLASS='Voice Switch','Asset','Site'),[Record Type])

With this I would like to add another if statement based on a flag.

when I add the below to the current expression at the end of 'Site;) QlikView indicates an error in expression

,if(HR05_Invalid_CLLI=1,'Site','Asset'),[Record Type])

What is the possible issue. I have a couple of instances where I need to have what I call nested if statement in a single expression.nce

Thanks in advance for you comments

Paul

1 Solution

Accepted Solutions
zhadrakas
Specialist II
Specialist II

i think you should break it down to the four possible cases:

=if(IsNull([Record Type]),
if(match(ASSET_CLASS,'Router','Data Switch','Firewall','Voice Switch') AND HR05_Invalid_CLLI=1,'Site',
if(HR05_Invalid_CLLI=1,'Asset',
if(match(ASSET_CLASS,'Router','Data Switch','Firewall','Voice Switch') AND HR05_Invalid_CLLI=0,'Asset',
if(HR05_Invalid_CLLI=0, 'Site'
,
[Record Type])))))

View solution in original post

6 Replies
zhadrakas
Specialist II
Specialist II

maybe like this

=if(IsNull([Record Type]),
if(match(ASSET_CLASS,'Router','Data Switch','Firewall','Voice Switch') AND HR05_Invalid_CLLI=1,'Asset','Site')
,
[Record Type])

pandreozzi
Creator
Creator
Author

Tim, I don't think that wilI work for my situation and here is my reasoning. In my original post the first condition indicates the Asset Class as Router or Data Switch or Firewall ect and the expected results are to set the Record Type as an Asset first and then Site second. Your example, although a good suggestion, would indicate to me that one of the "or" conditions would need to be meet first "and" this second condition with the result of Asset first followed by Site.

I am trying to create two conditions where the first are based on the "or" with the expected result and the second based in the "HR05_Invalid_CLLI=1" with the reverse result of 'Site' first followed by 'Asset'

zhadrakas
Specialist II
Specialist II

i think you should break it down to the four possible cases:

=if(IsNull([Record Type]),
if(match(ASSET_CLASS,'Router','Data Switch','Firewall','Voice Switch') AND HR05_Invalid_CLLI=1,'Site',
if(HR05_Invalid_CLLI=1,'Asset',
if(match(ASSET_CLASS,'Router','Data Switch','Firewall','Voice Switch') AND HR05_Invalid_CLLI=0,'Asset',
if(HR05_Invalid_CLLI=0, 'Site'
,
[Record Type])))))

pandreozzi
Creator
Creator
Author

Ok let me look at this and let you know how it works out. Thanks in advance

pandreozzi
Creator
Creator
Author

Tim, what you posted seemed to work with a little more tweaking to get my expected result. I cannot thank you enough. 

zhadrakas
Specialist II
Specialist II

im glad i could help. Please mark that answer as correct to Close this thread.