<?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: Using a variable containing a text string value in an expression in a chart in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537908#M745264</link>
    <description>&lt;P&gt;I think both:&lt;/P&gt;&lt;P&gt;vDisplayDepartment=vDepartment1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; and&lt;BR /&gt;{$(vDisplayDepartment)}&lt;/P&gt;&lt;P&gt;will fail because of missing quotes and/or spaces in the content.&lt;/P&gt;&lt;P&gt;I suggest to remove this logic and to use just selections within the field Department and should there really a good reason of using a second source to select the values to switch the variable/button approach to an additionally field-selection like:&lt;/P&gt;&lt;P&gt;ExtraDepartment:&lt;BR /&gt;load * inline [&lt;BR /&gt;ExtraDepartment&lt;BR /&gt;Dep1&lt;BR /&gt;Dep2&lt;BR /&gt;...&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;and then within the expression:&lt;/P&gt;&lt;P&gt;count({&amp;lt;Department=p(ExtraDepartment)&amp;gt;} [Staff ID])&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Thu, 31 Jan 2019 14:38:55 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2019-01-31T14:38:55Z</dc:date>
    <item>
      <title>Using a variable containing a text string value in an expression in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537860#M745250</link>
      <description>&lt;P&gt;Hoping someone can help. I've got a variable which is populated by a text string (department name containing a comma) upon a click of a button. This variable is then fed into a chart expression to customise a bar chart by specifying the department held in the Department field. Whilst this worked when the abbreviated names were used (with no spaces or commas), now it doesn't even though single quotes have been included. Please see below.&lt;/P&gt;&lt;P&gt;Expression in Chart:&lt;/P&gt;&lt;P&gt;=count({&amp;lt;Department={$(vDisplayDepartment)}&amp;gt;} [Staff ID])&lt;/P&gt;&lt;P&gt;Department Names stored in variables vDepartment1, vDepartment2 and vDepartment3 via the Document Settings &amp;gt; Variables Tab and are populated in the following format.&amp;nbsp; ='Department of Business, Law and Communication'&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Upon the click of the department button the variable vDisplayDepartment=vDepartment1 (the latter determined upon which button is clicked.&lt;/P&gt;&lt;P&gt;Like I said however, when I click the button the chart simply states there is no data to display.&lt;/P&gt;&lt;P&gt;Can anyone help?&lt;/P&gt;&lt;P&gt;Appreciated.&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537860#M745250</guid>
      <dc:creator>mattphillip</dc:creator>
      <dc:date>2024-11-16T04:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable containing a text string value in an expression in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537872#M745252</link>
      <description>Why not trying something like this:&lt;BR /&gt;=count({&amp;lt;Department={'$(=$(vDisplayDepartment))'}&amp;gt;} [Staff ID])</description>
      <pubDate>Thu, 31 Jan 2019 14:10:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537872#M745252</guid>
      <dc:creator>MindaugasBacius</dc:creator>
      <dc:date>2019-01-31T14:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable containing a text string value in an expression in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537877#M745254</link>
      <description>Thanks for the idea. I tried it but got the same result unfortunately.</description>
      <pubDate>Thu, 31 Jan 2019 14:15:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537877#M745254</guid>
      <dc:creator>mattphillip</dc:creator>
      <dc:date>2019-01-31T14:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable containing a text string value in an expression in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537890#M745256</link>
      <description>try this&lt;BR /&gt;&lt;BR /&gt;=count({&amp;lt;Department={$(=vDisplayDepartment)}&amp;gt;} [Staff ID])</description>
      <pubDate>Thu, 31 Jan 2019 14:28:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537890#M745256</guid>
      <dc:creator>pradosh_thakur</dc:creator>
      <dc:date>2019-01-31T14:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable containing a text string value in an expression in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537893#M745258</link>
      <description>Still the same result I'm afraid &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Jan 2019 14:30:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537893#M745258</guid>
      <dc:creator>mattphillip</dc:creator>
      <dc:date>2019-01-31T14:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable containing a text string value in an expression in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537896#M745260</link>
      <description>You may want to include the string in single quotes. for example 'abc', 'def','ghi' if spaces etc are included.</description>
      <pubDate>Thu, 31 Jan 2019 14:31:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537896#M745260</guid>
      <dc:creator>pradosh_thakur</dc:creator>
      <dc:date>2019-01-31T14:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable containing a text string value in an expression in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537903#M745262</link>
      <description>I've specified the variable string values via the Settings&amp;gt;Document Properties&amp;gt;Variables tab as follows:&lt;BR /&gt;&lt;BR /&gt;='Department of Business, Law and Communication'&lt;BR /&gt;&lt;BR /&gt;Am I missing something else?</description>
      <pubDate>Thu, 31 Jan 2019 14:35:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537903#M745262</guid>
      <dc:creator>mattphillip</dc:creator>
      <dc:date>2019-01-31T14:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable containing a text string value in an expression in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537908#M745264</link>
      <description>&lt;P&gt;I think both:&lt;/P&gt;&lt;P&gt;vDisplayDepartment=vDepartment1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; and&lt;BR /&gt;{$(vDisplayDepartment)}&lt;/P&gt;&lt;P&gt;will fail because of missing quotes and/or spaces in the content.&lt;/P&gt;&lt;P&gt;I suggest to remove this logic and to use just selections within the field Department and should there really a good reason of using a second source to select the values to switch the variable/button approach to an additionally field-selection like:&lt;/P&gt;&lt;P&gt;ExtraDepartment:&lt;BR /&gt;load * inline [&lt;BR /&gt;ExtraDepartment&lt;BR /&gt;Dep1&lt;BR /&gt;Dep2&lt;BR /&gt;...&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;and then within the expression:&lt;/P&gt;&lt;P&gt;count({&amp;lt;Department=p(ExtraDepartment)&amp;gt;} [Staff ID])&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 14:38:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537908#M745264</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-01-31T14:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable containing a text string value in an expression in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537913#M745265</link>
      <description>Thanks Marcus, I'll try that. Can you confirm what the p after the '=' is used for? Just trying to understand things a bit more.&lt;BR /&gt;Thanks,&lt;BR /&gt;Matt</description>
      <pubDate>Thu, 31 Jan 2019 14:44:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537913#M745265</guid>
      <dc:creator>mattphillip</dc:creator>
      <dc:date>2019-01-31T14:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable containing a text string value in an expression in a chart</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537928#M745266</link>
      <description>&lt;P&gt;p() and e() are special set analysis functions which return the possible respectively the excluded field-values of the specified field.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 14:57:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-containing-a-text-string-value-in-an-expression/m-p/1537928#M745266</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-01-31T14:57:10Z</dc:date>
    </item>
  </channel>
</rss>

