<?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 How to use a variable to create a dynamic expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-to-create-a-dynamic-expression/m-p/146710#M25226</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!!! That what my problem was :).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 13 Jun 2009 03:53:46 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-06-13T03:53:46Z</dc:date>
    <item>
      <title>How to use a variable to create a dynamic expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-to-create-a-dynamic-expression/m-p/146708#M25224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to QlikView so any help on this is greatly appreciated.&lt;/P&gt;&lt;P&gt;With the current version of our corporate dashboard, we have a simple bar chart with below expression define on the expression tab of the chart.&lt;/P&gt;&lt;P&gt;COUNT(ENROLLED_STUDENT_KEY) / COUNT(DISTINCT IF(ENROLLED_FLAG = 1, PERSON_ID))&lt;/P&gt;&lt;P&gt;The new requirement from our business users calls for dynamic calculation of the denominator as shown below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT(ENROLLED_STUDENT_KEY) / COUNT(DISTINCT IF( Dynamic Expression Here , PERSON_ID))&lt;/P&gt;&lt;P&gt;I attempted to use a variable as shown below. My idea was to have the value of the variable set to whatever the filter selected by the user. I tested this idea by defining the value the variable to 'ENROLLED_FLAG = 1' (without the quotes) but the chart would simply not render.&lt;/P&gt;&lt;P&gt;COUNT(ENROLLED_STUDENT_KEY)/COUNT(DISTINCT IF(=&lt;B&gt;&lt;I&gt;$(StudentPopulationFlag)&lt;/I&gt;&lt;/B&gt;, PERSON_ID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Jun 2009 03:34:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-to-create-a-dynamic-expression/m-p/146708#M25224</guid>
      <dc:creator />
      <dc:date>2009-06-13T03:34:48Z</dc:date>
    </item>
    <item>
      <title>How to use a variable to create a dynamic expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-to-create-a-dynamic-expression/m-p/146709#M25225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think you want the equal sign before the dollar sign expansion. Have you tried it without?&lt;/P&gt;&lt;P&gt;Other than that, the expression looks sound.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Jun 2009 03:41:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-to-create-a-dynamic-expression/m-p/146709#M25225</guid>
      <dc:creator />
      <dc:date>2009-06-13T03:41:06Z</dc:date>
    </item>
    <item>
      <title>How to use a variable to create a dynamic expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-to-create-a-dynamic-expression/m-p/146710#M25226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!!! That what my problem was :).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Jun 2009 03:53:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-a-variable-to-create-a-dynamic-expression/m-p/146710#M25226</guid>
      <dc:creator />
      <dc:date>2009-06-13T03:53:46Z</dc:date>
    </item>
  </channel>
</rss>

