<?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: Using total with count, set expression and date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1681983#M450130</link>
    <description>&lt;P&gt;Thanks for your input&amp;nbsp;&lt;SPAN&gt;Kaushik,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have now gone into the data load to make sure that the dates are the same format but I am still having issues with dates elsewhere (I have now left this set expression and I am working on another one. This one was left unresolved).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;These are the formats in the data load:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;date(order_fixed_date - (WEEKDAY(order_fixed_date)-1),'DD/MM/YYYY') as sale_week&lt;/P&gt;&lt;P&gt;date(added_stamp - (WEEKDAY(added_stamp)-1), 'DD/MM/YYYY') as stock_week&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both variables are made so that they have a cast type of date in postgres before any SQL transformations.&lt;/P&gt;&lt;P&gt;These variables are the same in some observations (see attachment)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Set analysis dates table snippet.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/29613i5BED891EBE8A75C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Set analysis dates table snippet.PNG" alt="Set analysis dates table snippet.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However when I do&amp;nbsp; =count({&amp;lt;stock_week=sale_week&amp;gt;} scan_id)/min({&amp;lt;stock_week=sale_week&amp;gt;} stock_added)&lt;/P&gt;&lt;P&gt;the chart tells me that there is not data because it contains only undefined values. Can you understand why that is the case? Again thanks for your support.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 10:10:29 GMT</pubDate>
    <dc:creator>Giansonn</dc:creator>
    <dc:date>2020-03-05T10:10:29Z</dc:date>
    <item>
      <title>Using total with count, set expression and date</title>
      <link>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1681321#M450089</link>
      <description>&lt;P&gt;I am trying to run an expression whereby I calculate the total given a set date.&lt;/P&gt;&lt;P&gt;The date I retrieve using min(stock_week) which works fine.&lt;/P&gt;&lt;P&gt;I then try to do:&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;stock_week={'(min(stock_week)'}&amp;gt;} total scan_id)&lt;/P&gt;&lt;P&gt;This expression however gives me zeros see attached, why is this the case?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="STR Set Expression.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/29513i093DAFF50B64AE4C/image-size/large?v=v2&amp;amp;px=999" role="button" title="STR Set Expression.PNG" alt="STR Set Expression.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;NOTE: I have also tried:&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;date(stock_week,'DD/MM/YYYY')={"(date(min(stock_week),'DD/MM/YYYY'))"}&amp;gt;} total scan_id)&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 14:10:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1681321#M450089</guid>
      <dc:creator>Giansonn</dc:creator>
      <dc:date>2020-03-03T14:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using total with count, set expression and date</title>
      <link>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1681347#M450091</link>
      <description>&lt;P&gt;Your expression should be&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=count({$&amp;lt;stock_week={"$(=min(stock_week))"}&amp;gt;} total scan_id)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 14:38:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1681347#M450091</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2020-03-03T14:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using total with count, set expression and date</title>
      <link>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1681983#M450130</link>
      <description>&lt;P&gt;Thanks for your input&amp;nbsp;&lt;SPAN&gt;Kaushik,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have now gone into the data load to make sure that the dates are the same format but I am still having issues with dates elsewhere (I have now left this set expression and I am working on another one. This one was left unresolved).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;These are the formats in the data load:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;date(order_fixed_date - (WEEKDAY(order_fixed_date)-1),'DD/MM/YYYY') as sale_week&lt;/P&gt;&lt;P&gt;date(added_stamp - (WEEKDAY(added_stamp)-1), 'DD/MM/YYYY') as stock_week&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both variables are made so that they have a cast type of date in postgres before any SQL transformations.&lt;/P&gt;&lt;P&gt;These variables are the same in some observations (see attachment)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Set analysis dates table snippet.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/29613i5BED891EBE8A75C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Set analysis dates table snippet.PNG" alt="Set analysis dates table snippet.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However when I do&amp;nbsp; =count({&amp;lt;stock_week=sale_week&amp;gt;} scan_id)/min({&amp;lt;stock_week=sale_week&amp;gt;} stock_added)&lt;/P&gt;&lt;P&gt;the chart tells me that there is not data because it contains only undefined values. Can you understand why that is the case? Again thanks for your support.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 10:10:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1681983#M450130</guid>
      <dc:creator>Giansonn</dc:creator>
      <dc:date>2020-03-05T10:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using total with count, set expression and date</title>
      <link>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1681984#M450131</link>
      <description>&lt;P&gt;The same for&amp;nbsp;=count({&amp;lt;stock_week={'sale_week'}&amp;gt;} scan_id)/min({&amp;lt;stock_week={'sale_week'}&amp;gt;} stock_added)&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 10:12:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1681984#M450131</guid>
      <dc:creator>Giansonn</dc:creator>
      <dc:date>2020-03-05T10:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using total with count, set expression and date</title>
      <link>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1682015#M450132</link>
      <description>&lt;P&gt;Okay I am fixing this using a flag:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the dataload I am doing:&lt;/P&gt;&lt;P&gt;join(STR)&lt;BR /&gt;Load&lt;BR /&gt;scan_id,&lt;BR /&gt;If(stock_week = sale_week, 1, 0) as week_flag&lt;BR /&gt;Resident STR;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think set analysis is made for dates so I would suggest doing everything in the data load&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 11:30:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1682015#M450132</guid>
      <dc:creator>Giansonn</dc:creator>
      <dc:date>2020-03-05T11:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using total with count, set expression and date</title>
      <link>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1683770#M450257</link>
      <description>&lt;P&gt;Hi Kaushik, again thanks for the answer, I am one step closer now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see attached pictures. The formula is no longer broken however I am not seeing the right numbers.&lt;/P&gt;&lt;P&gt;These are the numbers I should see:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="STR 1.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/29895iB7CD7C2CBA6032B7/image-size/large?v=v2&amp;amp;px=999" role="button" title="STR 1.PNG" alt="STR 1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And these are the numbers that I now have:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="STR 2.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/29896iB430160B31DA626C/image-size/large?v=v2&amp;amp;px=999" role="button" title="STR 2.PNG" alt="STR 2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have also added the min stock week for the observation for greater clarity, I want to total scans that have the same stock week as min(stock_week)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 13:21:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-total-with-count-set-expression-and-date/m-p/1683770#M450257</guid>
      <dc:creator>Giansonn</dc:creator>
      <dc:date>2020-03-11T13:21:48Z</dc:date>
    </item>
  </channel>
</rss>

