<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: &amp;quot;And&amp;quot; function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873317#M72043</link>
    <description>&lt;P&gt;Indeed you have an issue - country = 1 and country = 2 will always be false, since it can't be both. In your case, when Country has multiple values selected, all of these will be false since Country is not equal to any single value. &lt;/P&gt;
&lt;P&gt;Instead, you might try:&lt;/P&gt;
&lt;P&gt;If(GetNotSelectedCount(Country)&amp;gt;0,Somecolor,SomeOtherColor)&lt;/P&gt;
&lt;P&gt;Note that this forces the user to select all the countries, and it will behave differently if the user hasn't selected anything (which typically behaves the same way as selecting all of them), though.&lt;/P&gt;
&lt;P&gt;Another option is to use GetFieldSelections() and combine that with the Match() function, e.g.&lt;/P&gt;
&lt;P&gt;If(Wildmatch(GetFieldSelections(Country,',',12),'*Country1*','*Country2*'),SomeColor, SomeOtherColor)&lt;/P&gt;
&lt;P&gt;Note that the 12 allows up to 12 values to be returned, if your list of countries is longer you'll need to increase it.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Dec 2021 14:45:07 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2021-12-20T14:45:07Z</dc:date>
    <item>
      <title>"And" function</title>
      <link>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873311#M72042</link>
      <description>&lt;P&gt;I do not have much experience with the 'and' function.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Here should be a correct version if the user chooses only Country&amp;nbsp; number 1. &lt;/EM&gt;The table changes row colors based on if Country number 1 is selected. &lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;=if([Country]='1', if(Even(RowNO(total))=0, rgb(152,251,152),rgb(144,238,144)),&lt;/P&gt;
&lt;P&gt;if(Even(RowNO(total))=0, rgb(224,255,255),rgb(175,238,238)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;HOWEVER, now I want to change it so that if the user selects ALL of the countries at once (from the drop-down menu) the color function will still work.&amp;nbsp;&lt;/EM&gt;I clearly have a problem with the 'and' function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;=if((Country= ’1’ and Country= ’2’ and Country= ’3’ and Country= ’4’ and Country = ’5’ and Country= ’6’ and Country= ’7’ and Country= ’8’ and Country= ’9’ and Country= ’10’, if(Even(RowNO(total))=0, rgb(152,251,152),rgb(0,255,127)),&lt;/P&gt;
&lt;P&gt;=if((Country=’1’ and Country=’2’ and Country=’3’ and Country=’4’ and Country =’5’ and Country=’6’ and Country=’7’ and Country=’8’ and Country=’9’ and Country=’10’, if(Even(RowNO(total))=0, rgb(224,255,255),rgb(175,238,238)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please assist. Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 14:20:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873311#M72042</guid>
      <dc:creator>Breezy</dc:creator>
      <dc:date>2021-12-20T14:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: "And" function</title>
      <link>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873317#M72043</link>
      <description>&lt;P&gt;Indeed you have an issue - country = 1 and country = 2 will always be false, since it can't be both. In your case, when Country has multiple values selected, all of these will be false since Country is not equal to any single value. &lt;/P&gt;
&lt;P&gt;Instead, you might try:&lt;/P&gt;
&lt;P&gt;If(GetNotSelectedCount(Country)&amp;gt;0,Somecolor,SomeOtherColor)&lt;/P&gt;
&lt;P&gt;Note that this forces the user to select all the countries, and it will behave differently if the user hasn't selected anything (which typically behaves the same way as selecting all of them), though.&lt;/P&gt;
&lt;P&gt;Another option is to use GetFieldSelections() and combine that with the Match() function, e.g.&lt;/P&gt;
&lt;P&gt;If(Wildmatch(GetFieldSelections(Country,',',12),'*Country1*','*Country2*'),SomeColor, SomeOtherColor)&lt;/P&gt;
&lt;P&gt;Note that the 12 allows up to 12 values to be returned, if your list of countries is longer you'll need to increase it.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 14:45:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873317#M72043</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-12-20T14:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: "And" function</title>
      <link>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873417#M72050</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;How would I maintain my colors though? I have one table, that, depending on if all values are selected or not, have different alternating colors (such as: all values selected (or if zero values selected) is alternating light blue and dark blue and any other value combination = red and light red). I'm not sure how to incorporate my 'even(row)...' part into your code.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I see you wrote:&lt;/STRONG&gt;&amp;nbsp; If(GetNotSelectedCount(Country)&amp;gt;0,Somecolor,SomeOtherColor)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;My original had the alternating rows like this:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;=if([Country]='1', if(Even(RowNO(total))=0, rgb(152,251,152),rgb(144,238,144)),&lt;/P&gt;
&lt;P&gt;if(Even(RowNO(total))=0, rgb(224,255,255),rgb(175,238,238)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;So i am trying a combination of yours and mine:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;If(GetNotSelectedCount(Country)&amp;gt;0,rgb(152,251,152),rgb(0,255,127)),&lt;/P&gt;
&lt;P&gt;if(Even(RowNO(total))=0, rgb(224,255,255),rgb(175,238,238)))&lt;/P&gt;
&lt;P&gt;That will not work though....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 18:47:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873417#M72050</guid>
      <dc:creator>Breezy</dc:creator>
      <dc:date>2021-12-20T18:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: "And" function</title>
      <link>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873492#M72053</link>
      <description>&lt;P&gt;Something along the lines of:&lt;/P&gt;
&lt;P&gt;If(Even(RowNo(total)),if(GetNotSelectedCount(Country)&amp;gt;0,StripeColor,OtherStripeColor),if(GetNotSelectedCount(Country)&amp;gt;0,NonStripeColor,OtherNonStripeColor)))&lt;/P&gt;
&lt;P&gt;Should probably work? Likely this can be cleaned up so the condition isn't repeated but I figured answering now would be more helpful than if/when I have a chance to sit down and refactor it.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 20:10:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873492#M72053</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-12-20T20:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: "And" function</title>
      <link>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873551#M72056</link>
      <description>&lt;P&gt;Hmmm, something is wrong with the condition there. I have four colors but regardless of whether I select all "Country", no "Country" or any individual (or one+two, etc.) the stripes stay the same. And only two colors appear (as opposed to four).&lt;/P&gt;
&lt;P&gt;Here is what I did. I took the formula you recommended:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If(Even(RowNo(total)),if(GetNotSelectedCount('Country')&amp;gt;0,rgb(152,251,152),&lt;FONT color="#FF00FF"&gt;rgb(139,69,19)&lt;/FONT&gt;),if(GetNotSelectedCount('Country')&amp;gt;0,rgb(51,51,255),&lt;FONT color="#FF00FF"&gt;rgb(255,0,0)&lt;/FONT&gt;))&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;The colors that appear in my zebra stripes are:&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;brown (139,69,19)&lt;/P&gt;
&lt;P&gt;red (255,0,0)&lt;/P&gt;
&lt;P&gt;I should have all four colors (depending what I select determines which zebra pattern occurs)&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 23:33:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873551#M72056</guid>
      <dc:creator>Breezy</dc:creator>
      <dc:date>2021-12-20T23:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: "And" function</title>
      <link>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873713#M72073</link>
      <description>&lt;P&gt;Remove the quotes from 'Country'. You're referring to a field name, and using quotes tells Qlik it's actually a string, not a field.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 10:10:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1873713#M72073</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-12-21T10:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: "And" function</title>
      <link>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1874470#M72118</link>
      <description>&lt;P&gt;I took the quotes away from &lt;STRONG&gt;Country&lt;/STRONG&gt;. It's still giving me only two zebra stripes instead of four though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If(Even(RowNo(total)),if(GetNotSelectedCount([Country])&amp;gt;0,rgb(152,251,152),rgb(139,69,19)),if(GetNotSelectedCount([Country])&amp;gt;0,rgb(51,51,255),rgb(255,0,0)))&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 21:05:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1874470#M72118</guid>
      <dc:creator>Breezy</dc:creator>
      <dc:date>2021-12-22T21:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: "And" function</title>
      <link>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1874668#M72129</link>
      <description>&lt;P&gt;I'm afraid this is as far as I can go without actually having access to what it is you're working with. There's probably a logical error in there somewhere but I can't see it just reading the formula.&lt;/P&gt;
&lt;P&gt;What I suggest you do is break up the formula into chunks and place them in the table, until you find out which part isn't working correctly and why, e.g. create measures such as&lt;/P&gt;
&lt;P&gt;If(Even(RowNo(total)),1,0) and see if that part works as expected&lt;/P&gt;
&lt;P&gt;GetNotSelectedCount(Country) and see if that works as expected&lt;/P&gt;
&lt;P&gt;etc.&lt;/P&gt;
&lt;P&gt;Doing this typically isolates the problem.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 12:20:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1874668#M72129</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-12-23T12:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: "And" function</title>
      <link>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1874691#M72133</link>
      <description>&lt;P&gt;I will do that! Thank you for your time and advice. Cheers!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 13:11:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/quot-And-quot-function/m-p/1874691#M72133</guid>
      <dc:creator>Breezy</dc:creator>
      <dc:date>2021-12-23T13:11:26Z</dc:date>
    </item>
  </channel>
</rss>

