<?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 variable evaluation in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328438#M826544</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey all &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a variable as follows &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vMax_Period_ID&lt;/P&gt;&lt;P&gt;max({&amp;lt;MonthYR={"&amp;lt;=$(=max(AWESOME_IDEA_2))"}&amp;gt;}PAC_PERIOD_ID) " no equal sign prior to formula"&lt;/P&gt;&lt;P&gt;now im trying to use this variable in a set analysis and this variable should return one value for each item&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my set analysis &lt;/P&gt;&lt;P&gt;=only({&amp;lt;&lt;SPAN style="font-size: 10pt;"&gt;PAC_PERIOD_ID={"$(=$(vMax_Period_ID))"}&amp;gt;}ITEM_COST)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;yet the variable &lt;/SPAN&gt;doesn't&lt;SPAN style="font-size: 10pt;"&gt; evaluate properly &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;if we replace the variable with a hard coded value it works just fine &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;IMG alt="variable.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/169099_variable.PNG" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>kaldubai</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>variable evaluation in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328438#M826544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey all &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a variable as follows &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vMax_Period_ID&lt;/P&gt;&lt;P&gt;max({&amp;lt;MonthYR={"&amp;lt;=$(=max(AWESOME_IDEA_2))"}&amp;gt;}PAC_PERIOD_ID) " no equal sign prior to formula"&lt;/P&gt;&lt;P&gt;now im trying to use this variable in a set analysis and this variable should return one value for each item&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my set analysis &lt;/P&gt;&lt;P&gt;=only({&amp;lt;&lt;SPAN style="font-size: 10pt;"&gt;PAC_PERIOD_ID={"$(=$(vMax_Period_ID))"}&amp;gt;}ITEM_COST)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;yet the variable &lt;/SPAN&gt;doesn't&lt;SPAN style="font-size: 10pt;"&gt; evaluate properly &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;if we replace the variable with a hard coded value it works just fine &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;IMG alt="variable.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/169099_variable.PNG" style="height: auto;" /&gt;&lt;/SPAN&gt;&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/variable-evaluation-in-set-analysis/m-p/1328438#M826544</guid>
      <dc:creator>kaldubai</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: variable evaluation in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328439#M826545</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;Try&lt;/P&gt;&lt;P&gt;Aggr(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=only({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;PAC_PERIOD_ID={"$(=$(vMax_Period_ID))"}&amp;gt;}ITEM_COST), &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;ITEM_COST)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 07:09:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328439#M826545</guid>
      <dc:creator>ahaahaaha</dc:creator>
      <dc:date>2017-07-05T07:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: variable evaluation in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328440#M826546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or, may be even without aggr(), like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;only({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-size: 10pt; font-family: 'courier new', courier;"&gt;PAC_PERIOD_ID={"$&lt;SPAN style="color: #ff0000;"&gt;(&lt;STRONG&gt;=$&lt;/STRONG&gt;(&lt;/SPAN&gt;vMax_Period_ID))"}&amp;gt;}ITEM_COST)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 07:15:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328440#M826546</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-07-05T07:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: variable evaluation in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328441#M826547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you guys but your responses have not changed anything&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 09:03:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328441#M826547</guid>
      <dc:creator>kaldubai</dc:creator>
      <dc:date>2017-07-05T09:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: variable evaluation in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328442#M826548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What if you replace the variable's double quotes to single quote&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Max({&amp;lt;MonthYR={&lt;SPAN style="color: #ff0000;"&gt;'&lt;/SPAN&gt;&amp;lt;=$(=Max(AWESOME_IDEA_2))&lt;SPAN style="color: #ff0000;"&gt;'&lt;/SPAN&gt;}&amp;gt;}PAC_PERIOD_ID)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 12:11:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328442#M826548</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-05T12:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: variable evaluation in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328443#M826549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the variable actually evaluates correctly but not when inserted&amp;nbsp; into set analysis &lt;/P&gt;&lt;P&gt;if you may see my above picture ,the variable column actually returns corrects values&lt;/P&gt;&lt;P&gt;im assuming that the variable is not evaluated properly in the set analysis could be syntax 'single or double quotation, dollar sign expansion '&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 12:20:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328443#M826549</guid>
      <dc:creator>kaldubai</dc:creator>
      <dc:date>2017-07-05T12:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: variable evaluation in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328444#M826550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I understand your issue.... if you look at the image you posted, only where variable is 60022, set analysis column has a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" src="https://community.qlik.com/legacyfs/online/169178_Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that you are expecting set analysis to be evaluated for each dimension, but it only evaluates per chart. So in your case the &lt;STRONG&gt;Max({&amp;lt;MonthYR={"&amp;lt;=$(=Max(AWESOME_IDEA_2))"}&amp;gt;}PAC_PERIOD_ID) = 60022&lt;/STRONG&gt; which is used across all your dimensions. In order to resolve this issue.... you can use Aggr() function instead of using set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(If(PAC_PERIOD_ID = Max(TOTAL &amp;lt;ORGANIZATION_ID, item_code&amp;gt; {&amp;lt;MonthYR={"&amp;lt;=$(=Max(AWESOME_IDEA_2))"}&amp;gt;}PAC_PERIOD_ID), ITEM_COST), ORGANIZATION_ID, item_code, PAC_PERIOD_ID)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 12:33:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328444#M826550</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-05T12:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: variable evaluation in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328445#M826551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so you Much Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your answer is correct and it is giving me correct values yet Im missing the logic you used there ,what total has to do here ???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 13:56:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328445#M826551</guid>
      <dc:creator>kaldubai</dc:creator>
      <dc:date>2017-07-05T13:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: variable evaluation in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328446#M826552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although your table has only two dimensions, I have using three dimensions in the Aggr() function. The reason I had to use &lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;PAC_PERIOD_ID &lt;/STRONG&gt;&lt;/SPAN&gt;as a dimension is because I am using that in the If statement non aggregated which requires me to add it as a dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Aggr(If(&lt;SPAN style="color: #ff0000;"&gt;PAC_PERIOD_ID&lt;/SPAN&gt; = Max(TOTAL &amp;lt;ORGANIZATION_ID, item_code&amp;gt; {&amp;lt;MonthYR={"&amp;lt;=$(=Max(AWESOME_IDEA_2))"}&amp;gt;}PAC_PERIOD_ID)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now to get a single value (Max based on ORGANIZATION_ID and item_code), I had to use total key word with both the dimension.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An easy way to see this would be to do like this Create a new straight table with three dimensions&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;ORGANIZATION_ID&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;item_code&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;PAC_PERIOD_ID&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and try these expressions&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;1) PAC_PERIOD_ID&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;2) Max(TOTAL &amp;lt;ORGANIZATION_ID, item_code&amp;gt; {&amp;lt;MonthYR={"&amp;lt;=$(=Max(AWESOME_IDEA_2))"}&amp;gt;}PAC_PERIOD_ID)&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;3) If(PAC_PERIOD_ID = Max(TOTAL &amp;lt;ORGANIZATION_ID, item_code&amp;gt; {&amp;lt;MonthYR={"&amp;lt;=$(=Max(AWESOME_IDEA_2))"}&amp;gt;}PAC_PERIOD_ID), ITEM_COST)&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you do this, you will sort of understand what I am doing here&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2017 14:03:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-evaluation-in-set-analysis/m-p/1328446#M826552</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-07-05T14:03:48Z</dc:date>
    </item>
  </channel>
</rss>

