Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

If statement questions

Hi QlikView Peers,

I need help with following statement. I was able to change "Legal" to "Global Functions - Other" but somehow the script isn't able to include  "Compliance & Control" to "Global Functions - Other". Please help.


     IF([Primary Sector Impacted_1]='CC-Staff' and [Primary Business Impacted]='Legal' OR 'Compliance & Control', 'Global Functions - Other')

Thanks,


Jasmine

1 Solution

Accepted Solutions
jerem1234
Valued Contributor II

Re: If statement questions

You cant use the OR like you are using it, you would have to specify [Primary Business Impacted] = 'Compliance & Control' again.

Try this if statement:

IF([Primary Sector Impacted_1]='CC-Staff' and ([Primary Business Impacted]='Legal' OR [Primary Business Impacted] = 'Compliance & Control'), 'Global Functions - Other')


or you could use the match function:


IF([Primary Sector Impacted_1]='CC-Staff' and match([Primary Business Impacted], 'Legal', 'Compliance & Control'), 'Global Functions - Other')


Hope this helps!

4 Replies
yfe
Contributor III

Re: If statement questions

Please try:

  IF([Primary Sector Impacted_1]='CC-Staff' and [Primary Business Impacted]='Legal' OR [Primary Business Impacted]= 'Compliance & Control', 'Global Functions - Other')


thanks

Yaniv

jerem1234
Valued Contributor II

Re: If statement questions

You cant use the OR like you are using it, you would have to specify [Primary Business Impacted] = 'Compliance & Control' again.

Try this if statement:

IF([Primary Sector Impacted_1]='CC-Staff' and ([Primary Business Impacted]='Legal' OR [Primary Business Impacted] = 'Compliance & Control'), 'Global Functions - Other')


or you could use the match function:


IF([Primary Sector Impacted_1]='CC-Staff' and match([Primary Business Impacted], 'Legal', 'Compliance & Control'), 'Global Functions - Other')


Hope this helps!

mov
Esteemed Contributor III

Re: If statement questions

IF([Primary Sector Impacted_1]='CC-Staff' and match([Primary Business Impacted],'Legal', 'Compliance & Control'), 'Global Functions - Other')

Not applicable

Re: If statement questions

Thank you for your quick responses.

Community Browser