<?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 count distinct with a condition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330314#M1175420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are missing a "(" between distinct and if ( which then also needs an additional ")" after OrderID)&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;﻿﻿count(distinct(if(ShippedDate&amp;gt;RequiredDate,OrderID)))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 May 2012 13:27:39 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-31T13:27:39Z</dc:date>
    <item>
      <title>count distinct with a condition</title>
      <link>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330310#M1175416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;BR /&gt;i'm new to qlikview &lt;BR /&gt;i want to make an expression in Qlikview which will count number of late order&lt;/P&gt;&lt;P&gt;in SQL it will be like this&lt;BR /&gt;SELECT [OrderID] FROM &lt;TABLE&gt; where ShippedDate&amp;gt;RequiredDate&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i try this expression&lt;/P&gt;&lt;P&gt;Count(DISTINCT if (ShippedDate&amp;gt;RequiredDate,OrderID)&lt;BR /&gt;but it give me wrong result &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anyone help me ?&lt;/P&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 19:32:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330310#M1175416</guid>
      <dc:creator />
      <dc:date>2012-05-30T19:32:48Z</dc:date>
    </item>
    <item>
      <title>count distinct with a condition</title>
      <link>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330311#M1175417</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 suggest first to load the order from the source:&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;SELECT [OrderID] FROM [table] where ShippedDate&amp;gt;RequiredDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;load distinct [OrderID] resident Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join (Table)&lt;/P&gt;&lt;P&gt;load *,&lt;/P&gt;&lt;P&gt;1 as count&lt;/P&gt;&lt;P&gt;resident Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count:&lt;/P&gt;&lt;P&gt;sum(count)&lt;/P&gt;&lt;P&gt;resident Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let me know if my solution can help u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 20:26:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330311#M1175417</guid>
      <dc:creator>yvesqlik</dc:creator>
      <dc:date>2012-05-30T20:26:37Z</dc:date>
    </item>
    <item>
      <title>count distinct with a condition</title>
      <link>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330312#M1175418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For doing this in an expression you need to use ser analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do it like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first store the value of the "RequiredDate" in a variable, do it in the script or in the variable panel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let varReqDate = RequireDate ; //this assuming the format is clean&lt;/P&gt;&lt;P&gt; then...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count(Distinct {$&amp;lt;ShippedDate={"&amp;gt;$(varReqDate)"}&amp;gt;}OrderID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this might solve your problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 20:48:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330312#M1175418</guid>
      <dc:creator />
      <dc:date>2012-05-30T20:48:25Z</dc:date>
    </item>
    <item>
      <title>count distinct with a condition</title>
      <link>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330313#M1175419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your expression "Count(DISTINCT if (ShippedDate&amp;gt;RequiredDate,OrderID))" should work fine. Are you sure the dates are interpreted correctly? (So they are numeric)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2012 12:39:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330313#M1175419</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2012-05-31T12:39:00Z</dc:date>
    </item>
    <item>
      <title>count distinct with a condition</title>
      <link>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330314#M1175420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are missing a "(" between distinct and if ( which then also needs an additional ")" after OrderID)&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;﻿﻿count(distinct(if(ShippedDate&amp;gt;RequiredDate,OrderID)))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2012 13:27:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330314#M1175420</guid>
      <dc:creator />
      <dc:date>2012-05-31T13:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: count distinct with a condition</title>
      <link>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330315#M1175421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are missing a "(" between distinct and if ( which then also needs an additional ")" after OrderID)&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;﻿﻿count(distinct(if(ShippedDate&amp;gt;RequiredDate,OrderID)))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2012 13:28:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-distinct-with-a-condition/m-p/330315#M1175421</guid>
      <dc:creator />
      <dc:date>2012-05-31T13:28:16Z</dc:date>
    </item>
  </channel>
</rss>

