<?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: Please help with set anlysis syntax for distinct dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Please-help-with-set-anlysis-syntax-for-distinct-dates/m-p/735880#M263298</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry... I lied!.... the query I'm using is -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;sum &lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FORECAST_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'DD/MM/YYYY') = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ORDER_MONTH_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FORECAST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Oct 2014 23:20:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-15T23:20:05Z</dc:date>
    <item>
      <title>Please help with set anlysis syntax for distinct dates</title>
      <link>https://community.qlik.com/t5/QlikView/Please-help-with-set-anlysis-syntax-for-distinct-dates/m-p/735879#M263297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hoping someone can help me please. I'm trying to create a chart merging two data sets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first data set is orders which takes the form-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ORDERID, CUSTOMERID, ORDERDATE, ORDER_DATE_MONTH etc&lt;/P&gt;&lt;P&gt;123,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12345,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13/4/2014,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/4/2014&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second data set is the forecast and looks like -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CUSTOMERID,&amp;nbsp; FORECASTDATE,&amp;nbsp; FORECAST&lt;/P&gt;&lt;P&gt;12345,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/4/2014,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created the first part of the chart okay using the first file. I have converted ORDERDATE to a month string as the dimention and counted the order numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to include a line for the forecast on this chart I have added the second file. The join key is customer ID as I want to be able to filter on customer and see only their sales and forecast as well as the total and some other groupings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The forecast is monthly and the date format is 1/6/2014 where the date is always the first of that month. I have created a date to compare to using the order date and monthstart, which I have called ORDER_MONTH_DATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm thinking I need to sum the forecast where the FORECASTDATE = ORDERDATE but I am getting incorrect figures as it's summing EVERY TIME it finds that date in the order file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My query sort of works and looks like this -&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum &lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FORECAST_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'DD/MM/YYYY' = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ORDER_MONTH_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FORECAST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;but what i need it to do is something like this - &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FORECAST_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'DD/MM/YYYY' = &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;distinct&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ORDER_MONTH_DATE)&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FORECAST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;So that it only finds one instance of each ORDER_MONTH_DATE,&amp;nbsp; but the above query doesn't work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;I'd really appreciate it if someone can solve this for me please! &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks in advance &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 23:14:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Please-help-with-set-anlysis-syntax-for-distinct-dates/m-p/735879#M263297</guid>
      <dc:creator />
      <dc:date>2014-10-15T23:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Please help with set anlysis syntax for distinct dates</title>
      <link>https://community.qlik.com/t5/QlikView/Please-help-with-set-anlysis-syntax-for-distinct-dates/m-p/735880#M263298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry... I lied!.... the query I'm using is -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;sum &lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;date#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FORECAST_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'DD/MM/YYYY') = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ORDER_MONTH_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;FORECAST&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Oct 2014 23:20:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Please-help-with-set-anlysis-syntax-for-distinct-dates/m-p/735880#M263298</guid>
      <dc:creator />
      <dc:date>2014-10-15T23:20:05Z</dc:date>
    </item>
  </channel>
</rss>

