<?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 greater than for date variable in set expression in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-greater-than-for-date-variable-in-set-expression/m-p/1817689#M66983</link>
    <description>&lt;P&gt;&lt;SPAN&gt;You need to enclose the date calculation in a $-expansion, like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=sum({&amp;lt; [Publications.timeofarrival]={"&amp;gt;$(=date($(vMaxCal)-(7*12),'M/D/YYYY'))"}, [_thisWeek]-={1}&amp;gt;} Publications.counter) /12&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jun 2021 16:47:40 GMT</pubDate>
    <dc:creator>GaryGiles</dc:creator>
    <dc:date>2021-06-24T16:47:40Z</dc:date>
    <item>
      <title>Using greater than for date variable in set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Using-greater-than-for-date-variable-in-set-expression/m-p/1817640#M66980</link>
      <description>&lt;P&gt;Im trying to calculate the 12 week rolling average prior to the most current week&lt;BR /&gt;&lt;BR /&gt;The most recent date is stored in variable $(vMaxCal) as an integer (currently it is 44365 for 6/18/2021)&lt;BR /&gt;&lt;BR /&gt;To get the 12 week average I need to get date field (timeofarrival) to be (&amp;gt; vMaxCal - 12 weeks) essentially&lt;BR /&gt;&lt;BR /&gt;how can I fix this set expression so that it works :&lt;BR /&gt;=sum({&amp;lt; [Publications.timeofarrival]={"&amp;gt;date($(vMaxCal)-(7*12),'M/D/YYYY')"}, [_thisWeek]-={1}&amp;gt;} Publications.counter) /12&lt;BR /&gt;&lt;BR /&gt;Btw, if i hard code the date in like this, it works:&lt;BR /&gt;=sum({&amp;lt; [Publications.timeofarrival]={"&amp;gt;3/26/2021"}, [_thisWeek]-={1}&amp;gt;} Publications.counter) /12&lt;BR /&gt;&lt;BR /&gt;also to add, the equation itself doesnt have any problem in terms of error messages, but the result in the visualization is a value of 0 instead of the actual average&amp;gt;&lt;BR /&gt;&lt;BR /&gt;If i create a KPI with JUST&amp;nbsp;date($(vMaxCal)-(7*12),'M/D/YYYY'), it works&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 14:21:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-greater-than-for-date-variable-in-set-expression/m-p/1817640#M66980</guid>
      <dc:creator>Panv</dc:creator>
      <dc:date>2021-06-24T14:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using greater than for date variable in set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Using-greater-than-for-date-variable-in-set-expression/m-p/1817689#M66983</link>
      <description>&lt;P&gt;&lt;SPAN&gt;You need to enclose the date calculation in a $-expansion, like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=sum({&amp;lt; [Publications.timeofarrival]={"&amp;gt;$(=date($(vMaxCal)-(7*12),'M/D/YYYY'))"}, [_thisWeek]-={1}&amp;gt;} Publications.counter) /12&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 16:47:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-greater-than-for-date-variable-in-set-expression/m-p/1817689#M66983</guid>
      <dc:creator>GaryGiles</dc:creator>
      <dc:date>2021-06-24T16:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using greater than for date variable in set expression</title>
      <link>https://community.qlik.com/t5/App-Development/Using-greater-than-for-date-variable-in-set-expression/m-p/1817715#M66986</link>
      <description>&lt;P&gt;Ahh perfect, thank you Gary!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 19:11:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-greater-than-for-date-variable-in-set-expression/m-p/1817715#M66986</guid>
      <dc:creator>Panv</dc:creator>
      <dc:date>2021-06-24T19:11:34Z</dc:date>
    </item>
  </channel>
</rss>

