<?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: Variables in set analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818668#M67101</link>
    <description>&lt;P&gt;heres another example using a simplified data model (has a list of Super and we just count them&lt;BR /&gt;&lt;BR /&gt;=count({&amp;lt;Super={"=count(Super)=max(total aggr(nodistinct count(Super),Super))"}&amp;gt;}Super)&lt;/P&gt;&lt;P&gt;maybe you can adopt this to your data model to something like :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;count({&amp;lt;txtSupervisor={"=
Count({&amp;lt;MonthYear = {'$(=$(vPreviousMonth))'}, txtCallType = {'External'}, txtFormType = {'Coaching'}, txtSegment = {'Member Services'} &amp;gt;} id)
=
max(aggr(Count({&amp;lt;MonthYear = {'$(=$(vPreviousMonth))'}, txtCallType = {'External'}, txtFormType = {'Coaching'}, txtSegment = {'Member Services'} &amp;gt;} id), txtSupervisor))
"}
&amp;gt;} txtSupervisor)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hard to validate without the actual data model&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jun 2021 18:17:06 GMT</pubDate>
    <dc:creator>edwin</dc:creator>
    <dc:date>2021-06-29T18:17:06Z</dc:date>
    <item>
      <title>Variables in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818643#M67096</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following variable vTopSupervisor&amp;nbsp;&lt;/P&gt;&lt;P&gt;max(aggr(Count({&amp;lt;MonthYear = {'$(=$(vPreviousMonth))'}, txtCallType = {'External'}, txtFormType = {'Coaching'}, txtSegment = {'Member Services'} &amp;gt;} id), txtSupervisor))&lt;/P&gt;&lt;P&gt;This returns the count of ids for the supervisor with the max number of ids.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to return the value of the txtSupervisor field that this max count of ids by supervisor corresponds to.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to create a second variable off of this first variable to do this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to use the second variable that returns the value of the txtSupervisor field in a set analysis expression in my chart.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help or insight would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 16:43:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818643#M67096</guid>
      <dc:creator>danaleota1</dc:creator>
      <dc:date>2021-06-29T16:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818660#M67098</link>
      <description>&lt;P&gt;a quick solution would be:&lt;BR /&gt;create a variable (say vMaxSuperCount) to store the max count&lt;BR /&gt;in your table add calculated dimension, uncheck include Null values&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=if(aggr(count(Super),Super)=$(vMaxSuperCount),Super)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 18:04:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818660#M67098</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-06-29T18:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818661#M67099</link>
      <description>&lt;P&gt;the variable needs to be immediate&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 18:04:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818661#M67099</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-06-29T18:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818668#M67101</link>
      <description>&lt;P&gt;heres another example using a simplified data model (has a list of Super and we just count them&lt;BR /&gt;&lt;BR /&gt;=count({&amp;lt;Super={"=count(Super)=max(total aggr(nodistinct count(Super),Super))"}&amp;gt;}Super)&lt;/P&gt;&lt;P&gt;maybe you can adopt this to your data model to something like :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;count({&amp;lt;txtSupervisor={"=
Count({&amp;lt;MonthYear = {'$(=$(vPreviousMonth))'}, txtCallType = {'External'}, txtFormType = {'Coaching'}, txtSegment = {'Member Services'} &amp;gt;} id)
=
max(aggr(Count({&amp;lt;MonthYear = {'$(=$(vPreviousMonth))'}, txtCallType = {'External'}, txtFormType = {'Coaching'}, txtSegment = {'Member Services'} &amp;gt;} id), txtSupervisor))
"}
&amp;gt;} txtSupervisor)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hard to validate without the actual data model&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 18:17:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818668#M67101</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-06-29T18:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818676#M67104</link>
      <description>&lt;P&gt;also, i think there is a problem with your aggr expression, you need to add all the set analysis modifiers in your max() function, otherwise once selections are made especially with the field in your set analysis, the max will not give you the correct result.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 18:28:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818676#M67104</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-06-29T18:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818688#M67107</link>
      <description>&lt;P&gt;for the dimension I followed along your first solution:&lt;/P&gt;&lt;P&gt;=if(aggr(Count({&amp;lt;MonthYear = {'$(=$(vPreviousMonth))'}, txtCallType = {'External'}, txtFormType = {'Coaching'}, txtSegment = {'Member Services'} &amp;gt;} id),txtSupervisor) = $(vTopSupervisor), txtSupervisor)&lt;/P&gt;&lt;P&gt;disabled nulls,&amp;nbsp;&lt;/P&gt;&lt;P&gt;and it returns the Supervisor's name that I was expecting.&amp;nbsp; I applied it to a bar chart where I wanted to only show the employees under that supervisor with the max count of ids (errors), I was able to do that using the employee as my first dimension then the if statement above for the supervisor for the second dimension.&amp;nbsp; it did work.&amp;nbsp; I will try to apply your other solutions as well, but the first response I applied right away and it worked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 19:11:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Variables-in-set-analysis/m-p/1818688#M67107</guid>
      <dc:creator>danaleota1</dc:creator>
      <dc:date>2021-06-29T19:11:53Z</dc:date>
    </item>
  </channel>
</rss>

