<?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: enabling/disabling expressions based on selections in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/enabling-disabling-expressions-based-on-selections/m-p/317571#M1192695</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Angus thanks for your reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;what if i wanna do it like what i've described in another discussion &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://community.qlik.com/thread/30437"&gt;http://community.qlik.com/thread/30437&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i will have 2 list boxes, 1 list box with the location field and 1 list box with sales, costs and netrevenue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as described in that discussion, sales/costs/netrevenue will be the dimensions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and assuming i have location1 location2 and location3 under the field location&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by default there would be 3 sets of bars (sales, costs and netrevenue) and each set of bars will 3 bars that are location-specific...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i only selected sales and costs, there would only be 2 sets of bars, each set having 3 location bars since i did not specifically select the location to look at&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i only selected sales, there would only be 1 set of bars n the set having 3 location bars since again i did not specifically select the location to look at&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i only selected sales, location2 and location3, there would again be only 1 set of bars. however, this set of bars will only have 2 bars since i only selected 2 locations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sales/costs/netrevenue/location are currently 4 fields in my table...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jun 2011 05:15:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-06-24T05:15:44Z</dc:date>
    <item>
      <title>enabling/disabling expressions based on selections</title>
      <link>https://community.qlik.com/t5/QlikView/enabling-disabling-expressions-based-on-selections/m-p/317569#M1192693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi guys, let's say i have a bar chart and a list box with sales, costs and netrevenue as its selections&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the chart shows sales, costs and netrevenue as its expressions with location as the dimension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by default all 3 bars will be shown. whenever i select only sales from the list box, only the sales bar will be enabled and the rest disabled and whenever i select sales and costs, only the sales bar and costs bar will appear...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;through some searching, it seems that i can do some coding/macro to enable/disable the expressions based on the list box's selection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how do i go about doing that for my case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 02:13:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/enabling-disabling-expressions-based-on-selections/m-p/317569#M1192693</guid>
      <dc:creator />
      <dc:date>2011-06-24T02:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: enabling/disabling expressions based on selections</title>
      <link>https://community.qlik.com/t5/QlikView/enabling-disabling-expressions-based-on-selections/m-p/317570#M1192694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could do it with coding / macros.  The coding/macro approach would&lt;/P&gt;&lt;P&gt;be something like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.	create MeasureName as an artificial dimension (i.e. create a&lt;/P&gt;&lt;P&gt;table in your script that has MeasureName as its only field, and&lt;/P&gt;&lt;P&gt;populate it with the 3 values via INLINE)&lt;/P&gt;&lt;P&gt;2.	create a variable for each Measure that tests if that Measure is&lt;/P&gt;&lt;P&gt;selected or possible (e.g. vSalesIsSelected), using&lt;/P&gt;&lt;P&gt;GetFieldSelections(). Make sure the expression has '=' on the front of&lt;/P&gt;&lt;P&gt;it.  &lt;/P&gt;&lt;P&gt;3.	in your chart, create the expression for Sales as something like&lt;/P&gt;&lt;P&gt;if(vSalesIsSelected,calculation), so that the expression is always null&lt;/P&gt;&lt;P&gt;when Sales isn't selected (and hence QlikView won't display it).&lt;/P&gt;&lt;P&gt;Similarly define the expressions for the other two measures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An alternative approach is to design your data model so that the&lt;/P&gt;&lt;P&gt;appropriate table has &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*	&lt;/P&gt;&lt;P&gt;	a field called MeasureName (which can have values 'Sales','Cost'&lt;/P&gt;&lt;P&gt;or 'Net Revenue') and &lt;/P&gt;&lt;P&gt;*	&lt;/P&gt;&lt;P&gt;	a field called MeasureValue, giving the value of Sales, Cost or&lt;/P&gt;&lt;P&gt;Net Revenue as required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, your list box shows MeasureName, and your chart has MeasureName as&lt;/P&gt;&lt;P&gt;one of the dimensions.  This avoids the messiness of variables &amp;amp; extra&lt;/P&gt;&lt;P&gt;expressions - at the cost of possibly changing your data model.  Pros &amp;amp;&lt;/P&gt;&lt;P&gt;cons!&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Angus.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 03:47:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/enabling-disabling-expressions-based-on-selections/m-p/317570#M1192694</guid>
      <dc:creator>gussfish</dc:creator>
      <dc:date>2011-06-24T03:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: enabling/disabling expressions based on selections</title>
      <link>https://community.qlik.com/t5/QlikView/enabling-disabling-expressions-based-on-selections/m-p/317571#M1192695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Angus thanks for your reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;what if i wanna do it like what i've described in another discussion &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://community.qlik.com/thread/30437"&gt;http://community.qlik.com/thread/30437&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i will have 2 list boxes, 1 list box with the location field and 1 list box with sales, costs and netrevenue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as described in that discussion, sales/costs/netrevenue will be the dimensions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and assuming i have location1 location2 and location3 under the field location&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by default there would be 3 sets of bars (sales, costs and netrevenue) and each set of bars will 3 bars that are location-specific...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i only selected sales and costs, there would only be 2 sets of bars, each set having 3 location bars since i did not specifically select the location to look at&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i only selected sales, there would only be 1 set of bars n the set having 3 location bars since again i did not specifically select the location to look at&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i only selected sales, location2 and location3, there would again be only 1 set of bars. however, this set of bars will only have 2 bars since i only selected 2 locations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sales/costs/netrevenue/location are currently 4 fields in my table...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 05:15:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/enabling-disabling-expressions-based-on-selections/m-p/317571#M1192695</guid>
      <dc:creator />
      <dc:date>2011-06-24T05:15:44Z</dc:date>
    </item>
  </channel>
</rss>

