<?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 AGGR function using list of dimension built in a variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/AGGR-function-using-list-of-dimension-built-in-a-variable/m-p/710024#M255799</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to create an expression using the AGGR function. The dimensions for AGGR function, however, need to be flexible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created two variables:&lt;/P&gt;&lt;P&gt;vExclDim loads dimensions to be excluded &lt;SPAN style="font-size: 8pt;"&gt;'['&amp;amp;&lt;SPAN style="color: #0000ff;"&gt;Concat&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;FieldsExcl&lt;/SPAN&gt;,']=,[')&amp;amp;']= ' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vDimList loads dimensions list as following &lt;SPAN style="font-size: 8pt;"&gt; '['&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Concat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fields&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'],[')&amp;amp;'] ' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following function works as supposed:&lt;/P&gt;&lt;P&gt;AGGR(nodistinct count({$&amp;lt;Material=,[Material Type]=&amp;gt;} ID) , [Month] )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use &lt;STRONG&gt;vExclDim&lt;/STRONG&gt; and &lt;STRONG&gt;vDimList&lt;/STRONG&gt; to replace the dimension names above with the string loaded by variables:&lt;/P&gt;&lt;P&gt;aggr(nodistinct count({&amp;lt;$(vExclDim)&amp;gt;} ID), [Month])&amp;nbsp; ----&amp;gt; this works&lt;/P&gt;&lt;P&gt;aggr(nodistinct count({&amp;lt;"=$(vExclDim)"&amp;gt;} ID), [Month])&amp;nbsp; -----&amp;gt; works&lt;/P&gt;&lt;P&gt;aggr(nodistinct count({&amp;lt;"=$(vExclDim)"&amp;gt;} ID), $(vDimList)) -----&amp;gt; DOESN'T work. The cells display a hyphen '-'.&lt;/P&gt;&lt;P&gt;aggr(nodistinct count({&amp;lt;"=$(vExclDim)"&amp;gt;} ID), '$(vDimList)') -----&amp;gt; DOESN'T work. The cells display a hyphen '-'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is where I am not doing right?&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;Maria &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 28 Sep 2014 03:06:11 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-09-28T03:06:11Z</dc:date>
    <item>
      <title>AGGR function using list of dimension built in a variable</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-function-using-list-of-dimension-built-in-a-variable/m-p/710024#M255799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to create an expression using the AGGR function. The dimensions for AGGR function, however, need to be flexible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created two variables:&lt;/P&gt;&lt;P&gt;vExclDim loads dimensions to be excluded &lt;SPAN style="font-size: 8pt;"&gt;'['&amp;amp;&lt;SPAN style="color: #0000ff;"&gt;Concat&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;FieldsExcl&lt;/SPAN&gt;,']=,[')&amp;amp;']= ' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;vDimList loads dimensions list as following &lt;SPAN style="font-size: 8pt;"&gt; '['&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Concat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fields&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'],[')&amp;amp;'] ' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following function works as supposed:&lt;/P&gt;&lt;P&gt;AGGR(nodistinct count({$&amp;lt;Material=,[Material Type]=&amp;gt;} ID) , [Month] )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use &lt;STRONG&gt;vExclDim&lt;/STRONG&gt; and &lt;STRONG&gt;vDimList&lt;/STRONG&gt; to replace the dimension names above with the string loaded by variables:&lt;/P&gt;&lt;P&gt;aggr(nodistinct count({&amp;lt;$(vExclDim)&amp;gt;} ID), [Month])&amp;nbsp; ----&amp;gt; this works&lt;/P&gt;&lt;P&gt;aggr(nodistinct count({&amp;lt;"=$(vExclDim)"&amp;gt;} ID), [Month])&amp;nbsp; -----&amp;gt; works&lt;/P&gt;&lt;P&gt;aggr(nodistinct count({&amp;lt;"=$(vExclDim)"&amp;gt;} ID), $(vDimList)) -----&amp;gt; DOESN'T work. The cells display a hyphen '-'.&lt;/P&gt;&lt;P&gt;aggr(nodistinct count({&amp;lt;"=$(vExclDim)"&amp;gt;} ID), '$(vDimList)') -----&amp;gt; DOESN'T work. The cells display a hyphen '-'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is where I am not doing right?&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;Maria &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Sep 2014 03:06:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-function-using-list-of-dimension-built-in-a-variable/m-p/710024#M255799</guid>
      <dc:creator />
      <dc:date>2014-09-28T03:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: AGGR function using list of dimension built in a variable</title>
      <link>https://community.qlik.com/t5/QlikView/AGGR-function-using-list-of-dimension-built-in-a-variable/m-p/710025#M255800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana,geneva; font-size: 10pt;"&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; Here is the solution I found.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana,geneva; font-size: 10pt;"&gt;vDimList&amp;nbsp; &lt;STRONG style="font-size: 14pt;"&gt;=&lt;/STRONG&gt;'['&amp;amp;&lt;SPAN style="color: #0000ff;"&gt;Concat&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Fields&lt;/SPAN&gt;,'],[')&amp;amp;'] ' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana,geneva; font-size: 10pt;"&gt;It loads the checked fields' names from a listbox.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana,geneva; font-size: 10pt;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;Equals sign&lt;/STRONG&gt; has to be typed in variable's definition.&lt;SPAN style="font-family: Arial;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: verdana,geneva; font-size: 10pt;"&gt;vDimList variable will load the string of dimensions. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana,geneva; font-size: 10pt;"&gt;E.g. [Month], [Partner], [Region]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana,geneva; font-size: 10pt;"&gt;Then, the aggregation formula&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: verdana,geneva; font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;nodistinct count&lt;/SPAN&gt;({&amp;lt;&lt;SPAN style="color: #808080;"&gt;&lt;EM&gt;&lt;STRONG&gt;$(vExclDim)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&amp;gt;} ID), &lt;STRONG&gt;&lt;EM style="color: #808080;"&gt;$(vDimList)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #333333;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: verdana,geneva;"&gt;will just work replace the variables with the strings previously loaded.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: verdana,geneva;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: verdana,geneva;"&gt;Maria&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2014 03:45:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/AGGR-function-using-list-of-dimension-built-in-a-variable/m-p/710025#M255800</guid>
      <dc:creator />
      <dc:date>2014-09-30T03:45:27Z</dc:date>
    </item>
  </channel>
</rss>

