<?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 Case when in QV in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Case-when-in-QV/m-p/429120#M159961</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a formula in a pivot table where I use case when and &amp;lt;&amp;gt; and LIKE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;Count distinct(case when [UOM for FROM_QTY.] &amp;lt;&amp;gt; 'RC' and TO_LOCATION LIKE '2%' then to_lic, else 0 end)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have been looking at different treads and I came up with this:&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;[UOM for FROM_QTY.]={"*"} - {'RC'}&amp;gt;}{$&amp;lt;TO_LOCATION={'2*'}&amp;gt;} distinct TO_LIC)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I need the counterpart of this one, so I tried:&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;[UOM for FROM_QTY.]={'RC'}&amp;gt;}{$&amp;lt;TO_LOCATION={'2*'}&amp;gt;} distinct TO_LIC)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that does not seem to give what I need,&lt;/P&gt;&lt;P&gt;They end up having the same count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions on why or how this is best solved?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Dec 2012 08:08:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-12-12T08:08:13Z</dc:date>
    <item>
      <title>Case when in QV</title>
      <link>https://community.qlik.com/t5/QlikView/Case-when-in-QV/m-p/429120#M159961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a formula in a pivot table where I use case when and &amp;lt;&amp;gt; and LIKE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;Count distinct(case when [UOM for FROM_QTY.] &amp;lt;&amp;gt; 'RC' and TO_LOCATION LIKE '2%' then to_lic, else 0 end)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have been looking at different treads and I came up with this:&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;[UOM for FROM_QTY.]={"*"} - {'RC'}&amp;gt;}{$&amp;lt;TO_LOCATION={'2*'}&amp;gt;} distinct TO_LIC)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I need the counterpart of this one, so I tried:&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;[UOM for FROM_QTY.]={'RC'}&amp;gt;}{$&amp;lt;TO_LOCATION={'2*'}&amp;gt;} distinct TO_LIC)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that does not seem to give what I need,&lt;/P&gt;&lt;P&gt;They end up having the same count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions on why or how this is best solved?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 08:08:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Case-when-in-QV/m-p/429120#M159961</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-12T08:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Case when in QV</title>
      <link>https://community.qlik.com/t5/QlikView/Case-when-in-QV/m-p/429121#M159962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried these two as well&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=COUNT(DISTINCT if(not([UOM for FROM_QTY.] like 'RC') and TO_LOCATION LIKE '2*',TO_LIC,0))&lt;/P&gt;&lt;P&gt;=COUNT(DISTINCT if(([UOM for FROM_QTY.] like 'RC') and TO_LOCATION LIKE '2*',TO_LIC,0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now get different figures between these two, but not the fiugres I expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 08:14:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Case-when-in-QV/m-p/429121#M159962</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-12T08:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Case when in QV</title>
      <link>https://community.qlik.com/t5/QlikView/Case-when-in-QV/m-p/429122#M159963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the if condition we never use else part. Remove that part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to use - sign before =&amp;nbsp; so that it will work like exclude.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;=count({$&amp;lt;[UOM for FROM_QTY.] -={'RC'}&amp;gt;}{$&amp;lt;TO_LOCATION={'2*'}&amp;gt;} distinct TO_LIC)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try same syntax with P() - E () using set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp; &lt;/P&gt;&lt;P&gt;Nirav Bhimani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 10:06:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Case-when-in-QV/m-p/429122#M159963</guid>
      <dc:creator>nirav_bhimani</dc:creator>
      <dc:date>2012-12-12T10:06:24Z</dc:date>
    </item>
  </channel>
</rss>

