<?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: Use a variable in set analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Use-a-variable-in-set-analysis/m-p/1514050#M37182</link>
    <description>&lt;P&gt;Sorry, I removed = character like that&lt;/P&gt;&lt;P&gt;count({$&amp;lt;dateAPAC={"&amp;lt;$(vMoins6mois)"}&amp;gt;}distinct idAP) but it doesn't work.&lt;/P&gt;&lt;P&gt;For example vMoins6mois=date(Date-183,'DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;I select 2018 october 1st with Date filter, so vMoins6mois= 2018 april 1st and I want to count idAP before this date.&lt;/P&gt;&lt;P&gt;The current result is 0... although there are idAP with a lower date&lt;/P&gt;</description>
    <pubDate>Thu, 29 Nov 2018 08:23:13 GMT</pubDate>
    <dc:creator>clemenceabad</dc:creator>
    <dc:date>2018-11-29T08:23:13Z</dc:date>
    <item>
      <title>Use a variable in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Use-a-variable-in-set-analysis/m-p/1513800#M37180</link>
      <description>&lt;P&gt;Hii,&lt;/P&gt;&lt;P&gt;In the script, I declare my variable vMoins6mois &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.JPG" style="width: 350px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1216iE010CA78A15B36E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.JPG" alt="1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and in the set analysis I want to count idAP that has a date lower than the declared variable&amp;nbsp; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.JPG" style="width: 372px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1217iBDAEA6778B3B2F12/image-dimensions/372x86?v=v2" width="372" height="86" role="button" title="2.JPG" alt="2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but it's not okay ...&lt;/P&gt;&lt;P&gt;I use Qlik Sense Enterprise September 2018 SR2&lt;/P&gt;&lt;P&gt;Thanks for help&lt;/P&gt;&lt;P&gt;Clem&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 22:06:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-a-variable-in-set-analysis/m-p/1513800#M37180</guid>
      <dc:creator>clemenceabad</dc:creator>
      <dc:date>2021-12-21T22:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Use a variable in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Use-a-variable-in-set-analysis/m-p/1513802#M37181</link>
      <description>&lt;P&gt;First remove the = character from your measure expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;And please post expressions as text instead of as screenshots. It's darn hard to copy text from images.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 17:34:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-a-variable-in-set-analysis/m-p/1513802#M37181</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2018-11-28T17:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Use a variable in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Use-a-variable-in-set-analysis/m-p/1514050#M37182</link>
      <description>&lt;P&gt;Sorry, I removed = character like that&lt;/P&gt;&lt;P&gt;count({$&amp;lt;dateAPAC={"&amp;lt;$(vMoins6mois)"}&amp;gt;}distinct idAP) but it doesn't work.&lt;/P&gt;&lt;P&gt;For example vMoins6mois=date(Date-183,'DD/MM/YYYY')&lt;/P&gt;&lt;P&gt;I select 2018 october 1st with Date filter, so vMoins6mois= 2018 april 1st and I want to count idAP before this date.&lt;/P&gt;&lt;P&gt;The current result is 0... although there are idAP with a lower date&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 08:23:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-a-variable-in-set-analysis/m-p/1514050#M37182</guid>
      <dc:creator>clemenceabad</dc:creator>
      <dc:date>2018-11-29T08:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Use a variable in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Use-a-variable-in-set-analysis/m-p/1520074#M37210</link>
      <description>&lt;P&gt;the expression you have in the variable is "Date-183" a reference to a field in your data model or another variable?&lt;/P&gt;&lt;P&gt;I'm going to assume it is a field.&lt;/P&gt;&lt;P&gt;The first thing I would do is to make sure the date fields in your data are stored in the default qlik date format, an easy way to do this is to load the date fields within Date(Num(Field)). Then when you do your search in Set analysis you don't get messed up by weird date formatting problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I would build you Set Analysis in layers...&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Does "Count(Distinct idAP)" work?&lt;/LI&gt;&lt;LI&gt;Count({$&amp;lt;dateAPAC = {"&amp;lt;1/1/2018"}&amp;gt;}Distinct idAP)&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Count({$&amp;lt;dateAPAC = {"$(='&amp;lt;' &amp;amp; Date(Max(Date-183))"}&amp;gt;}Distinct idAP)&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I think my third example is probably the one that will work for you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 21:44:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-a-variable-in-set-analysis/m-p/1520074#M37210</guid>
      <dc:creator>chriscammers</dc:creator>
      <dc:date>2018-12-12T21:44:30Z</dc:date>
    </item>
  </channel>
</rss>

