<?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: Set analytics inside IF statement does not reflect identifier. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analytics-inside-IF-statement-does-not-reflect-identifier/m-p/1051783#M466855</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(&lt;/P&gt;&lt;P&gt;&amp;nbsp; only({1}val)=2&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Count({1&amp;lt;EnterDTM={'&amp;gt;=$(=vToDate-29)'}&amp;gt;} DISTINCT Code)/30&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if(&lt;/P&gt;&lt;P&gt;&amp;nbsp; only({1}val)=1&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Count({1&amp;lt;EnterDTM={'&amp;gt;=$(=vToDate-2)'}&amp;gt;}DISTINCT Code)/3&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if(&lt;/P&gt;&lt;P&gt;&amp;nbsp; only({1}val)=3&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Count({1} DISTINCT Code)/vNumberOfDays&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,0&lt;/P&gt;&lt;P&gt;&amp;nbsp; )))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;val is a field too, so it is aggregated by default with the only() function if you don't specify an aggregation function. And that means it will be affected by selections.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jan 2016 17:46:59 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2016-01-11T17:46:59Z</dc:date>
    <item>
      <title>Set analytics inside IF statement does not reflect identifier.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analytics-inside-IF-statement-does-not-reflect-identifier/m-p/1051780#M466852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wanted my expression to show results only over two dimensions. Ones that are declared in the chart.&lt;/P&gt;&lt;P&gt;Dimensions: val, Entity&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;if(&lt;/P&gt;&lt;P&gt;&amp;nbsp; val=2&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Count({1&amp;lt;EnterDTM={'&amp;gt;=$(=Date(vToDate-29))'}&amp;gt;} DISTINCT Code)/30&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if(&lt;/P&gt;&lt;P&gt;&amp;nbsp; val=1&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Count({1&amp;lt;EnterDTM={'&amp;gt;=$(=Date(vToDate-2))'}&amp;gt;} DISTINCT Code)/3&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if(&lt;/P&gt;&lt;P&gt;&amp;nbsp; val=3&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Count({1} DISTINCT Code)/vNumberOfDays&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,0&lt;/P&gt;&lt;P&gt;&amp;nbsp; )))&lt;/P&gt;&lt;P&gt; However the result is reflecting all selections. What is wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2016 11:21:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analytics-inside-IF-statement-does-not-reflect-identifier/m-p/1051780#M466852</guid>
      <dc:creator>pkrouglov</dc:creator>
      <dc:date>2016-01-08T11:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set analytics inside IF statement does not reflect identifier.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analytics-inside-IF-statement-does-not-reflect-identifier/m-p/1051781#M466853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Usually variables are used in a dollar expansion: $(vToDate). But I can't say from just what you posted what's wrong. I have no idea how you defined your variables.&amp;nbsp; Do the separate count expressions work? Perhaps you can post a small qlikview document that illustrates the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2016 18:08:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analytics-inside-IF-statement-does-not-reflect-identifier/m-p/1051781#M466853</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-01-08T18:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Set analytics inside IF statement does not reflect identifier.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analytics-inside-IF-statement-does-not-reflect-identifier/m-p/1051782#M466854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please, find attached  "set analysis and if sample.qvw".&lt;/P&gt;&lt;P&gt;Expected result is that&lt;/P&gt;&lt;P&gt;In the chart "Updated records per day" values does not change according to&lt;/P&gt;&lt;P&gt;Attribute_Name and YearMonth selections.&lt;/P&gt;&lt;P&gt;However, the chart changes according those selections.&lt;/P&gt;&lt;P&gt;In the chart "Last 3 days" I am using the same expression, but w/o IF:&lt;/P&gt;&lt;P&gt;Count({&lt;STRONG&gt;1&lt;/STRONG&gt;&amp;lt;EnterDTM={'&amp;gt;=$(=vToDate-2)'}&amp;gt;}DISTINCT Code)/3&lt;/P&gt;&lt;P&gt;and values are not changing by the Attribute_Name and YearMonth selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pavel Krouglov&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Fri, Jan 8, 2016 at 8:08 PM, Gysbert Wassenaar &amp;lt;qcwebmaster@qlikview.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jan 2016 06:38:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analytics-inside-IF-statement-does-not-reflect-identifier/m-p/1051782#M466854</guid>
      <dc:creator>pkrouglov</dc:creator>
      <dc:date>2016-01-11T06:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Set analytics inside IF statement does not reflect identifier.</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analytics-inside-IF-statement-does-not-reflect-identifier/m-p/1051783#M466855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(&lt;/P&gt;&lt;P&gt;&amp;nbsp; only({1}val)=2&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Count({1&amp;lt;EnterDTM={'&amp;gt;=$(=vToDate-29)'}&amp;gt;} DISTINCT Code)/30&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if(&lt;/P&gt;&lt;P&gt;&amp;nbsp; only({1}val)=1&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Count({1&amp;lt;EnterDTM={'&amp;gt;=$(=vToDate-2)'}&amp;gt;}DISTINCT Code)/3&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if(&lt;/P&gt;&lt;P&gt;&amp;nbsp; only({1}val)=3&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,Count({1} DISTINCT Code)/vNumberOfDays&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,0&lt;/P&gt;&lt;P&gt;&amp;nbsp; )))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;val is a field too, so it is aggregated by default with the only() function if you don't specify an aggregation function. And that means it will be affected by selections.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jan 2016 17:46:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analytics-inside-IF-statement-does-not-reflect-identifier/m-p/1051783#M466855</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-01-11T17:46:59Z</dc:date>
    </item>
  </channel>
</rss>

