<?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: Dollar expansion not working in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Dollar-expansion-not-working/m-p/2484721#M101167</link>
    <description>&lt;P&gt;I would probably do:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;From= {"&amp;gt;=$(=vMaxDate-50)"}&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 01 Oct 2024 15:25:09 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2024-10-01T15:25:09Z</dc:date>
    <item>
      <title>Dollar expansion not working</title>
      <link>https://community.qlik.com/t5/App-Development/Dollar-expansion-not-working/m-p/2483978#M101106</link>
      <description>&lt;P&gt;I am trying to calculate a measure where I count the numbers if ID that have been open for at least 50 days in any given period.&lt;BR /&gt;&lt;BR /&gt;I have a facts table where each ID has a FactsType = 'Open'. This is linked to the Calendar for all days from Start to Close - 1. This means that I want to calculate the number of distinct ID which are linked to the calendar on the Max(Date), who have a FactsType = 'Open' and where Max(Date) - From &amp;gt; 50.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a variable for Max(Date) called vMaxDate.&lt;BR /&gt;&lt;BR /&gt;My expression looks like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count(DISTINCT 
    Aggr(
        If("=$(vMaxDate)" - From &amp;gt; 50, ID),
        ID
    )
    {&amp;lt;FactsType = {'Open'}, Date = {"=$(vMaxDate)"}&amp;gt;}
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the dollar expansions do not work for whatever reason.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Could someone help me?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:47:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dollar-expansion-not-working/m-p/2483978#M101106</guid>
      <dc:creator>L_VN</dc:creator>
      <dc:date>2024-09-27T10:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dollar expansion not working</title>
      <link>https://community.qlik.com/t5/App-Development/Dollar-expansion-not-working/m-p/2483982#M101107</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/242199"&gt;@L_VN&lt;/a&gt;&amp;nbsp; try below&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Count(DISTINCT {&amp;lt;FactsType = {'Open'},ID = {"=$(vMaxDate)-From &amp;gt;50"}&amp;gt;} ID)

or

Count(DISTINCT {&amp;lt;FactsType = {'Open'}&amp;gt;}aggr(if($(vMaxDate)-From &amp;gt;50,ID),ID))
&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:56:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dollar-expansion-not-working/m-p/2483982#M101107</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-09-27T10:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dollar expansion not working</title>
      <link>https://community.qlik.com/t5/App-Development/Dollar-expansion-not-working/m-p/2483986#M101108</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/242199"&gt;@L_VN&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;How is the variable vMaxDate defined?&lt;BR /&gt;&lt;BR /&gt;Does it contain a result, for instance: =DATE(Today(), 'M/D/YYYY') then the output = 9/27/2024&amp;nbsp;&lt;BR /&gt;or only the base formula without starting with = the output would be :&amp;nbsp;&amp;nbsp;DATE(Today(), 'M/D/YYYY')&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Based on the result of the variable the first usage of the variable could not need an dollar sign expansion. When you use $(vMaxDate) on the result 9/27/2024 it will calculate&amp;nbsp;1,6469038208169&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="p_verkooijen_1-1727434947797.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/172242iD0CCFA8832A41BFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="p_verkooijen_1-1727434947797.png" alt="p_verkooijen_1-1727434947797.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also the use of "" for the IF is incorrect, you only need it in the Set Analysis&lt;BR /&gt;&lt;BR /&gt;Count(DISTINCT &lt;BR /&gt;Aggr(&lt;BR /&gt;If($(vMaxDate) - From &amp;gt; 50, ID),&lt;BR /&gt;ID&lt;BR /&gt;)&lt;BR /&gt;{&amp;lt;FactsType = {'Open'}, Date = {"=$(vMaxDate)"}&amp;gt;}&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;Besides that the complete expression seems incorrect.&lt;/P&gt;
&lt;P&gt;This should work&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Count({&amp;lt;FactsType = {'Open'}, From= {"&amp;gt;=$(vMaxDate)-50"}, Date = {"$(vMaxDate)"}&amp;gt;} DISTINCT ID)&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;BR /&gt;Please provide an output sample / formatting of&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;vMaxDate&lt;/LI&gt;
&lt;LI&gt;From&lt;/LI&gt;
&lt;LI&gt;Date&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 11:11:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dollar-expansion-not-working/m-p/2483986#M101108</guid>
      <dc:creator>p_verkooijen</dc:creator>
      <dc:date>2024-09-27T11:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dollar expansion not working</title>
      <link>https://community.qlik.com/t5/App-Development/Dollar-expansion-not-working/m-p/2484255#M101135</link>
      <description>&lt;P&gt;Oh, I never knew that the equals sign made a difference.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All three are floored ints, so it should work. I don't think this works. Qlik seems to interpret it as the string value (see my attached image).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;From= {"&amp;gt;=$(vMaxDate)-50"}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="L_VN_0-1727679836315.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/172301iF8E083857E0768A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="L_VN_0-1727679836315.png" alt="L_VN_0-1727679836315.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Edit: I moved the parenthesis to include the calculation&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 07:34:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dollar-expansion-not-working/m-p/2484255#M101135</guid>
      <dc:creator>L_VN</dc:creator>
      <dc:date>2024-09-30T07:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dollar expansion not working</title>
      <link>https://community.qlik.com/t5/App-Development/Dollar-expansion-not-working/m-p/2484721#M101167</link>
      <description>&lt;P&gt;I would probably do:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;From= {"&amp;gt;=$(=vMaxDate-50)"}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 01 Oct 2024 15:25:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dollar-expansion-not-working/m-p/2484721#M101167</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-10-01T15:25:09Z</dc:date>
    </item>
  </channel>
</rss>

