<?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: Re: Re: Dynamic Variable calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660969#M240956</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DV,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a great suggestion. It worked well. However, in my case, this should work without the primary key in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am thinking an Aggr() possibly. That does the trick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(Aggr(Pick( Match(F1, $(vTest)), $(vMyValue)) * SUM([F4]), F1))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Jun 2014 13:30:16 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-06-12T13:30:16Z</dc:date>
    <item>
      <title>Dynamic Variable calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660965#M240952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would it be possible to assign a variable as a field for every row and then have it change the metric calculation dynamically based on user input as shown below?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var1 = 1&lt;/P&gt;&lt;P&gt;var2 = 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;Col1, Col2, Col3, measure&lt;/P&gt;&lt;P&gt;rec1, dim1, var1, 1&lt;/P&gt;&lt;P&gt;rec2, dim1, var1, 2&lt;/P&gt;&lt;P&gt;rec3, dim2, var2, 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way the user can do a variable input to their heart's content for the what-if simulation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The INPUTFIELD concept is limiting in that it is an all or nothing feature and to selectively apply it to dim1 and dim2 with var1 and var2 respectively is not working out. Looking for creative ways to handle the what-if situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried doing SUM(Measure)*$(=Col3) and $($(=Col3)) to no success.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 16:20:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660965#M240952</guid>
      <dc:creator />
      <dc:date>2014-06-11T16:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Variable calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660966#M240953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not quite following what you want...can you provide examples?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 16:31:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660966#M240953</guid>
      <dc:creator>Jason_Michaelides</dc:creator>
      <dc:date>2014-06-11T16:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Dynamic Variable calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660967#M240954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 17:49:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660967#M240954</guid>
      <dc:creator />
      <dc:date>2014-06-11T17:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Dynamic Variable calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660968#M240955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Hi Amir,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;You can get this working in 3 steps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; text-decoration: underline;"&gt;&lt;STRONG&gt;Step 1: Set Variable&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;EM style="color: #000080;"&gt;vTest =Concat(DISTINCT Chr(39) &amp;amp; F1 &amp;amp; Chr(39), ', ')&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;EM style="color: #000080;"&gt;vMyValue =Concat( Chr(39) &amp;amp; Chr(36) &amp;amp; '(' &amp;amp; F3 &amp;amp; ')' &amp;amp; Chr(39) , ' , ')&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-family: calibri, verdana, arial, sans-serif;"&gt;Note: You need the "=" sign before the Concat() function while assigning the expressions in the above variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;Step 2: Assign Dimension&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;EM style=": ; color: #000080;"&gt;Add [F1] or Primary Key in your table as Dimension Field&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;Step 3: Use the below Expression in the Expression Tab&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;EM&gt;Pick( Match(F1, $(vTest)), $(vMyValue)) * [F4]&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Now, if you change the value in the variable you see the changes in the straight Table. See the attached and hope this is what you need.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;DV&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2014 09:32:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660968#M240955</guid>
      <dc:creator>IAMDV</dc:creator>
      <dc:date>2014-06-12T09:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Dynamic Variable calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660969#M240956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DV,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a great suggestion. It worked well. However, in my case, this should work without the primary key in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am thinking an Aggr() possibly. That does the trick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(Aggr(Pick( Match(F1, $(vTest)), $(vMyValue)) * SUM([F4]), F1))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2014 13:30:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660969#M240956</guid>
      <dc:creator />
      <dc:date>2014-06-12T13:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Dynamic Variable calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660970#M240957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;I'm glad it worked. Makes sense to use Aggr() if you don't have primary key or probably add all other columns to make it unique.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif;"&gt;DV&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2014 14:16:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Variable-calculation/m-p/660970#M240957</guid>
      <dc:creator>IAMDV</dc:creator>
      <dc:date>2014-06-12T14:16:19Z</dc:date>
    </item>
  </channel>
</rss>

