<?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: Dynamically create the aggr expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamically-create-the-aggr-expression/m-p/830169#M292152</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I want dim1 to appear only when they have selected something from Dim1 and as and when some value is chosen in Dim2 and Dim3 then the expression should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(sum(net_amount), dim) when nothing is chosen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(sum(net_amount), dim,dim1) when a value in dim1 is chosen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(sum(net_amount), dim,dim1, dim2) when a value in dim1 and dim 2 is chosen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Mar 2015 13:45:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-03-31T13:45:09Z</dc:date>
    <item>
      <title>Dynamically create the aggr expression</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-create-the-aggr-expression/m-p/830167#M292150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;I want to generate my aggr expression dynamically depending on what the user selects&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;So aggr(sum(net_amount), contract_id)&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt; mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;will be the basic&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;In case they select dim1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;It should be aggr(sum(net_amount), contract, dim1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;And if they choose dim1 and dim2 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;It should be aggr(sum(net_amount), contract, dim1, dim2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;Is this even possible ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;TIA&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 13:02:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-create-the-aggr-expression/m-p/830167#M292150</guid>
      <dc:creator />
      <dc:date>2015-03-31T13:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically create the aggr expression</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-create-the-aggr-expression/m-p/830168#M292151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes construct a variable vDim where you have an expression like (with Dim being the field where you select Dim1 or Dim2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;='Contract,'&amp;amp;Concat(Dim,',')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in your expression use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 16px;"&gt;aggr(sum(net_amount),&lt;/SPAN&gt;$(=vDim))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 13:29:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-create-the-aggr-expression/m-p/830168#M292151</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-03-31T13:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically create the aggr expression</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-create-the-aggr-expression/m-p/830169#M292152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I want dim1 to appear only when they have selected something from Dim1 and as and when some value is chosen in Dim2 and Dim3 then the expression should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(sum(net_amount), dim) when nothing is chosen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(sum(net_amount), dim,dim1) when a value in dim1 is chosen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(sum(net_amount), dim,dim1, dim2) when a value in dim1 and dim 2 is chosen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 13:45:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-create-the-aggr-expression/m-p/830169#M292152</guid>
      <dc:creator />
      <dc:date>2015-03-31T13:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically create the aggr expression</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamically-create-the-aggr-expression/m-p/830170#M292153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well you can put any condition in the variable definition right? So, put in vDim something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(GetSelectedCount(dim1)+&lt;SPAN style="font-size: 13.3333330154419px;"&gt;GetSelectedCount(dim2)=0,'dim',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;GetSelectedCount(dim1)=1 and &lt;SPAN style="font-size: 13.3333330154419px;"&gt;GetSelectedCount(dim2)=0&lt;/SPAN&gt;,'dim,dim1',&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(&lt;SPAN style="font-size: 13.3333330154419px;"&gt;GetSelectedCount(dim2)=1,'&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;dim,dim1, dim2'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;)))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 13:51:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamically-create-the-aggr-expression/m-p/830170#M292153</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-03-31T13:51:47Z</dc:date>
    </item>
  </channel>
</rss>

