<?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: Formula Inside Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038658#M641445</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you mean with 'doesn't work'?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you expect the average to be calculated per dimension line? Then this won't work indeed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Feb 2016 17:50:12 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-02-03T17:50:12Z</dc:date>
    <item>
      <title>Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038656#M641443</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;I want to use this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Only({&amp;lt;ATYPE={'VALUETYPE'},NUM_FROM={"&amp;lt;=1"},NUM_TO={"&amp;gt;=1"}&amp;gt;} NUM_RESULT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is working fine, NUM_RESULT is the right value that I'm expecting from a between check (1 is between NUM_FROM and NUM_TO).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I want to replace this 1 with a formula like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=avg({&amp;lt;BTYPE={'ANOTHERTYPE'},YEAR=P(Year)&amp;gt;} VALUE_PERC)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I'm using this fomula in a pivot column, I can use also the column alias as field)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it works as a new pivot column, but If I replace the 1 with this, it doesn't work. I tried also with variables but it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Only({&amp;lt;ATYPE={'VALUETYPE'},NUM_FROM={"&amp;lt;=$(vartest)"},NUM_TO={"&amp;gt;=$(vartest)"}&amp;gt;} NUM_RESULT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where vartest is&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;avg({&amp;lt;BTYPE={'ANOTHERTYPE'},YEAR=P(Year)&amp;gt;} VALUE_PERC)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you, best regards.&lt;/P&gt;&lt;P&gt;Riccardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 09:58:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038656#M641443</guid>
      <dc:creator>Riccardo</dc:creator>
      <dc:date>2016-02-03T09:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038657#M641444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have equal (=) before Avg in the variable? Try adding that and see if that helps?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 17:42:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038657#M641444</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-03T17:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038658#M641445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you mean with 'doesn't work'?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you expect the average to be calculated per dimension line? Then this won't work indeed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 17:50:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038658#M641445</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-03T17:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038659#M641446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I would like that the average will be calculated at dimension line......... How can I do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you, regards.&lt;/P&gt;&lt;P&gt;Riccardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 08:16:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038659#M641446</guid>
      <dc:creator>Riccardo</dc:creator>
      <dc:date>2016-02-08T08:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038660#M641447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I tried it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't work for every lines.. It seems doesn't work at dimension-line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I use a Calcolated Column ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 10:08:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038660#M641447</guid>
      <dc:creator>Riccardo</dc:creator>
      <dc:date>2016-02-08T10:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038661#M641448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set analysis is evaluated once per chart, not per dimension line, so you can't easily use set analysis here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start with advanced aggregation, something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=Only(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;{&amp;lt;ATYPE={'VALUETYPE'},NUM_FROM={"&amp;lt;=1"} &amp;gt;} &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Aggr(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If( NUM_TO &amp;gt;= avg({&amp;lt;BTYPE={'ANOTHERTYPE'},YEAR=P(Year)&amp;gt;} VALUE_PERC), NUM_RESULT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , &lt;EM&gt;YourChartDimension1, &lt;EM style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;YourChartDimension2, ... , NUM_TO&lt;/EM&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;EM&gt;&lt;EM style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/EM&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;EM&gt;&lt;EM style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;)&lt;/EM&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replace YourChartDimensionX with your chart dimension fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not 100% sure about the set expressions used in the inner and outer aggregation functions, so this may need to be adapted, too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general, it's easier to answer these questions knowing the data model and context,so if you still have issues,please post a small sample QVW.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 11:38:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038661#M641448</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-08T11:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038662#M641449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, thank you for reply. I'm going to check it and try it.... meanwhile I uploaded a little example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you, best regards.&lt;/P&gt;&lt;P&gt;Riccardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 12:04:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038662#M641449</guid>
      <dc:creator>Riccardo</dc:creator>
      <dc:date>2016-02-08T12:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038663#M641450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aggr(If(RANGE_TYPE = DIM_TYPE and VALUE &amp;gt;= RANGE_FROM and VALUE &amp;lt;= RANGE_TO, RANGE_VALUE), DIMENSION, RANGE_TO, RANGE_VALUE)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/113892_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 13:27:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038663#M641450</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-08T13:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038664#M641451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can start with an expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Only( Aggr( If( Sum(VALUE) &amp;gt;= RANGE_FROM AND Sum(VALUE) &amp;lt;= RANGE_TO AND RANGE_TYPE = DIM_TYPE, RANGE_VALUE), DIMENSION, RANGE_TYPE, RANGE_VALUE))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 13:29:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038664#M641451</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-08T13:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038665#M641452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And another approach using INTERVALMATCH in the script&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14549394730637040" jivemacro_uid="_14549394730637040"&gt;
&lt;P&gt;DIMFACT:&lt;/P&gt;
&lt;P&gt;LOAD DIMENSION, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VALUE, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DIM_TYPE&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;[DimFact.xlsx]&lt;/P&gt;
&lt;P&gt;(ooxml, embedded labels, table is DIMFACT);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;RANGEVALUES:&lt;/P&gt;
&lt;P&gt;LOAD RANGE_TYPE AS DIM_TYPE,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RANGE_FROM, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RANGE_TO, &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RANGE_VALUE&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;[RangeValues.xlsx]&lt;/P&gt;
&lt;P&gt;(ooxml, embedded labels, table is VALUESRANGE);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;JOIN&lt;/P&gt;
&lt;P&gt;IntervalMatch(VALUE, DIM_TYPE)&lt;/P&gt;
&lt;P&gt;LOAD RANGE_FROM, RANGE_TO, DIM_TYPE&lt;/P&gt;
&lt;P&gt;RESIDENT RANGEVALUES;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LEFT JOIN (DIMFACT)&lt;/P&gt;
&lt;P&gt;LOAD DIM_TYPE, VALUE, RANGE_VALUE&lt;/P&gt;
&lt;P&gt;RESIDENT RANGEVALUES;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP TABLE RANGEVALUES;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 13:51:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038665#M641452</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-08T13:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038666#M641454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi! Thank you, it is correct and It works fine &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; Thank you very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a second issue, similar logic but it uses the calculated new column for another range match. I uploaded the NEW app.... Can you check it for me please? Thank you very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 14:21:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038666#M641454</guid>
      <dc:creator>Riccardo</dc:creator>
      <dc:date>2016-02-08T14:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038667#M641457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;None of the Totals fall between the ranges for A or B. Am I reading this correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/113911_Capture.PNG" style="height: 522px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 16:27:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038667#M641457</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-08T16:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038668#M641460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep, you are right. I uploaded the wrong file......... just change range_value where type is A and B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 16:30:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038668#M641460</guid>
      <dc:creator>Riccardo</dc:creator>
      <dc:date>2016-02-08T16:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Inside Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038669#M641461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried changing the value for print A or B but it still doesn't work. It seems that I can't reuse column "TOTAL"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 16:32:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-Inside-Set-Analysis/m-p/1038669#M641461</guid>
      <dc:creator>Riccardo</dc:creator>
      <dc:date>2016-02-08T16:32:01Z</dc:date>
    </item>
  </channel>
</rss>

