Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Background color in button - exclude

Hi, QlikView Community

I have a simple dataset what you can look at in the excel file.

I have one trouble I am trying to solve regarding background color in button.

I have a button that has actions that is supposed to select two Company Codes (100 and 110).

And I use this formula below in the text button to change colors when Compmany Code 100 and 110.

=if(Concat(distinct [Company Code],',')='100,110',RGB(0, 240, 16), RGB(15, 48, 99))

It works exactly like I want to. But I how can use to the similar if formula to change colors in the button when I exclude

company code 100 and 110.

I know I could use this formula below for this dataset but I want to exclude 100 and 110

=if(Concat(distinct [Company Code],',')='120,130,140',RGB(0, 240, 16), RGB(15, 48, 99))

regards Darri

1 Solution

Accepted Solutions
avinashelite

push all those company code to variable and then compare the variable that will make the process automated

View solution in original post

5 Replies
avinashelite

Try like this

=if(Concat(distinct [Company Code],',')='120,130,140' and Concat(distinct [Company Code],',')<>'100,110',

if(Concat(distinct [Company Code],',')<>'100,110',RGB(0, 240, 16), RGB(15, 48, 99)))

Not applicable
Author

You can try this expression as well:

=IF(wildMatch(concat([Company Code],','),'*110*') AND wildMatch(concat([Company Code],','),'*100*'),RGB(0, 240, 16), RGB(15, 48, 99))

Anonymous
Not applicable
Author

Hi, Sakir Ali

This formula worked when I selected company code 100 and 110.

But I wanted it to worked if excluded 100 and 110.

Anonymous
Not applicable
Author

Hi, Avinah R

This formula worked exactly like I wanted.

But I am worried about when I have thousands company code and they are changing every month and it will a lot to work to update them.

Do you have any ideas?

regards Darri

avinashelite

push all those company code to variable and then compare the variable that will make the process automated