<?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 Trouble with OR in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235652#M86905</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to put together a basic table that gives me the sum of a field where the status meets certain criteria - see below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;sum&lt;/B&gt;(&lt;B&gt;if&lt;/B&gt;(&lt;B&gt;PA_Status&lt;/B&gt; = 'O',&lt;B&gt;Approved_LC&lt;/B&gt;)) ... this works !&lt;/P&gt;&lt;P&gt;sum(if(PA_Status = 'O' or 'C', Approved_LC)) ... this does not include the rows where the PA_Status is C ...&lt;/P&gt;&lt;P&gt;What is QlikView looking for here in place of OR. Could I use IN('C','O')?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Feb 2010 09:32:39 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-02-10T09:32:39Z</dc:date>
    <item>
      <title>Trouble with OR</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235652#M86905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to put together a basic table that gives me the sum of a field where the status meets certain criteria - see below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;sum&lt;/B&gt;(&lt;B&gt;if&lt;/B&gt;(&lt;B&gt;PA_Status&lt;/B&gt; = 'O',&lt;B&gt;Approved_LC&lt;/B&gt;)) ... this works !&lt;/P&gt;&lt;P&gt;sum(if(PA_Status = 'O' or 'C', Approved_LC)) ... this does not include the rows where the PA_Status is C ...&lt;/P&gt;&lt;P&gt;What is QlikView looking for here in place of OR. Could I use IN('C','O')?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 09:32:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235652#M86905</guid>
      <dc:creator />
      <dc:date>2010-02-10T09:32:39Z</dc:date>
    </item>
    <item>
      <title>Trouble with OR</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235653#M86906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;you need to write it like that&lt;/P&gt;&lt;P&gt;sum(if(PA_Status = 'O' or 'PA_Status = 'C', Approved_LC))&lt;/P&gt;&lt;P&gt;itws not nice but its works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 14:13:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235653#M86906</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2010-02-10T14:13:07Z</dc:date>
    </item>
    <item>
      <title>Trouble with OR</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235654#M86907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to mention field name again. Try following:&lt;/P&gt;&lt;P&gt;sum(if(PA_Status = 'O' or PA_Status = 'C', Approved_LC)) ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 15:12:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235654#M86907</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-10T15:12:05Z</dc:date>
    </item>
    <item>
      <title>Trouble with OR</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235655#M86908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Thanks for the posts, that works a treat ...&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 15:14:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235655#M86908</guid>
      <dc:creator />
      <dc:date>2010-02-10T15:14:26Z</dc:date>
    </item>
    <item>
      <title>Trouble with OR</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235656#M86909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or...&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum(if(match(PA_Status,'O','C'),Approved_LC))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 00:32:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235656#M86909</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-02-11T00:32:41Z</dc:date>
    </item>
    <item>
      <title>Trouble with OR</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235657#M86910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ooh ... I was so close ... I tried match() having done some research and spotted Rob's blog on it but I had written sum(match()) and missed the if out ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 09:00:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235657#M86910</guid>
      <dc:creator />
      <dc:date>2010-02-11T09:00:26Z</dc:date>
    </item>
    <item>
      <title>Trouble with OR</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235658#M86911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So following on from the use of match ... I am trying to combine two match statement within an IF statement to return a specific value against multiple records ... it is not quite working. Can anyone help with a quick pointer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(CurrencySelection = 'Local', sum(IF(match(PA_Status,'O','C','I') AND match(Claim_Status,'E' , 'H' , 'O' , 'R' , 'U' , 'B'),Approved_LC)), sum(IF(match(PA_Status,'O','C','I') AND match(Claim_Status,'E' , 'H' , 'O' , 'R' , 'U' , 'B'),Approved_PC)))&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Feb 2010 15:49:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235658#M86911</guid>
      <dc:creator />
      <dc:date>2010-02-23T15:49:51Z</dc:date>
    </item>
    <item>
      <title>Trouble with OR</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235659#M86912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, my computer ate my reply, but basically, I don't see anything wrong. What are you seeing, and what did you want to see instead?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Feb 2010 21:53:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235659#M86912</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-02-23T21:53:07Z</dc:date>
    </item>
    <item>
      <title>Trouble with OR</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235660#M86913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;The second match statement against Claim_Status is not being taken into account, it's like the AND function is not working ... basically, it is not adding up to what I know it should.&lt;/P&gt;&lt;P&gt;I have also tried match(PA_Status .... AND Claim_Status ...), so incorporating the AND into the the single match() function with the same result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Feb 2010 09:16:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235660#M86913</guid>
      <dc:creator />
      <dc:date>2010-02-24T09:16:43Z</dc:date>
    </item>
    <item>
      <title>Trouble with OR</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235661#M86914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;They should be separate match() functions. So match(field1,value1,...) and match(field2,value2,...), which is what you're doing.&lt;/P&gt;&lt;P&gt;Maybe you have a problem with Claim_Status. For instance, does it actually have a value of 'E ' instead of 'E'? Maybe those wouldn't match. You could do a trim(Claim_Status) in that case. Caps vs. lower case? What happens if you write it out the long, ugly way?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;...sum(if(match(...) and (Claim_Status='E' or Claim_Status='H'...),Approved_LC))...&lt;/P&gt;&lt;P&gt;If THAT works, then I'm really at a loss, since as best I can tell, that's exactly what your match() function should be doing. If it doesn't work, then it tells you the problem isn't with the match() at all, but rather with the values you're comparing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Feb 2010 00:53:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235661#M86914</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-02-27T00:53:11Z</dc:date>
    </item>
    <item>
      <title>Trouble with OR</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235662#M86915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Going back a little now but the below is still not returning correctly. I have a record that has a PA_Status of 'I' and a Claim_Status of 'U', it is being included in the calculation but I believe that according to the below it shouldn't be.&lt;/P&gt;&lt;P&gt;Do you have any suggestions what I have done wrong here ... it must be something simple that I am overlooking.&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;Sum(&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;IF(&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;match(PA_Status, 'C', 'I', 'O') AND&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;match(Claim_Status, 'E', 'H', 'O','R', 'B'),&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;Approved_LC))&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;P&gt;Sorry, just to add to that ... if I type it out the ugly way as below ... it returns the record as well ... I have done a view in the database and have pasted the results in below to prove that I am not mad ...&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;=IF((PA_Status = 'C' OR PA_Status = 'I' OR PA_Status = 'O') AND (Claim_Status = 'E' OR Claim_Status = 'H' OR Claim_Status = 'O' OR Claim_Status = 'R' OR Claim_Status = 'B'), Activity_ID)&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;ID Claim_Number PA_Status Claim_Status&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;1580 1217 I U&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;1580 1305 I U&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;Sorry ... solved it ... is was something stupid after all. Reload had not worked properly so the status was correct in SQL but incorrect in QlikView.&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 10:41:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-OR/m-p/235662#M86915</guid>
      <dc:creator />
      <dc:date>2010-04-15T10:41:19Z</dc:date>
    </item>
  </channel>
</rss>

