<?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: Expression/Variable help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379363#M811031</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your expression should be&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;= Count(distinct IF( [Invoice Date] &amp;gt;= '$(vMinDate)' AND [Invoice Date] &amp;lt;= '$(vMaxDate)',&amp;nbsp; [Supplier Name]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or using Set Analysis&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;= Count({&amp;lt;[Invoice Date] = {"&amp;gt;= $(vMinDate)&amp;lt;=$(vMaxDate)"}&amp;gt;} distinct [Supplier Name])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These return 1752 using your data&lt;/P&gt;&lt;P&gt;&lt;IMG alt="test count.JPG" class="jive-image image-1" src="/legacyfs/online/178283_test count.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Oct 2017 11:11:28 GMT</pubDate>
    <dc:creator>Colin-Albert</dc:creator>
    <dc:date>2017-10-02T11:11:28Z</dc:date>
    <item>
      <title>Expression/Variable help</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379359#M811027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have an expression, &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #3366ff;"&gt;Max( [Invoice Date])&lt;/SPAN&gt;,&lt;/SPAN&gt; that I have saved as a variable called MaxInv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I include the variable in the following expression, it's not returning the desired result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= Count( IF( '$(eMininv)' &amp;gt;= '$(vMaxDate)'&amp;nbsp; AND '$(eMinInv)' &amp;lt;= '$(vMaxDate)',&amp;nbsp; [Supplier Name]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379359#M811027</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expression/Variable help</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379360#M811028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gareth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you say "it is not returning the desired result", is it returning an incorrect count or nothing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have spelt eMinInv differently in your expression - QlikView is case sensitive&amp;nbsp; eMininv and eMinInv are two different variables to Qlik.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your max date variable is named MaxInv but this is not used in the expression you posted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you add your expression to a straight table chart with a blank label, you can hover over the column header and see how Qlik is evaluating your expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 10:25:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379360#M811028</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2017-10-02T10:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Expression/Variable help</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379361#M811029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check if the date formats are compatible in those variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 10:33:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379361#M811029</guid>
      <dc:creator>jduarte12</dc:creator>
      <dc:date>2017-10-02T10:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Expression/Variable help</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379362#M811030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Colin,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have amended the spelling errors, and it is now returning zero rather than 23,000! The expression should return 763.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached my file if this helps evaluate where I am going wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 10:35:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379362#M811030</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-02T10:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Expression/Variable help</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379363#M811031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your expression should be&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;= Count(distinct IF( [Invoice Date] &amp;gt;= '$(vMinDate)' AND [Invoice Date] &amp;lt;= '$(vMaxDate)',&amp;nbsp; [Supplier Name]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or using Set Analysis&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;= Count({&amp;lt;[Invoice Date] = {"&amp;gt;= $(vMinDate)&amp;lt;=$(vMaxDate)"}&amp;gt;} distinct [Supplier Name])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These return 1752 using your data&lt;/P&gt;&lt;P&gt;&lt;IMG alt="test count.JPG" class="jive-image image-1" src="/legacyfs/online/178283_test count.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 11:11:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379363#M811031</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2017-10-02T11:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Expression/Variable help</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379364#M811032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gareth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be you should try aggregating the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum(aggr(if($(eMinInv) &amp;gt;= (vMaxDate)&amp;nbsp; AND $(eMinInv) &amp;lt;= (vMaxDate), 1,0) [Supplier Name]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 11:12:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379364#M811032</guid>
      <dc:creator>snehamahaveer</dc:creator>
      <dc:date>2017-10-02T11:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Expression/Variable help</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379365#M811033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this expression which returns 763&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;= sum(aggr(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if( max({1} [Invoice Date]) &amp;gt;= date(floor(monthstart(makedate(min(Year), min(match(Month, 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'))))))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and max({1} [Invoice Date]) &amp;lt;= date(floor(monthend&amp;nbsp; (makedate(max(Year), max(match(Month, 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'))))))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;, 1), &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Supplier Number]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression would be simpler if your Month field was held as a correctly formatted dual field then the match() expression would not be needed to get the correct min &amp;amp; max values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the QlikView&amp;nbsp; Month() functions to derive month from dates rather than using text fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 11:37:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379365#M811033</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2017-10-02T11:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Expression/Variable help</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379366#M811034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Colin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That works exactly as I wanted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reference, how would I correctly format my Month field as a dual field, and then how would this change the expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 13:45:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-Variable-help/m-p/1379366#M811034</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-02T13:45:22Z</dc:date>
    </item>
  </channel>
</rss>

