<?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 Dynamic Measure on GetCurrentSelections in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-Measure-on-GetCurrentSelections/m-p/1201618#M875641</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Hi All,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;I am looking to have a dynamic measure in a chart based on a current selection on a dimension.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;In my example, I want it to give me measure (a) if I select the dimension 'month', and if 'month' is not selected, give me measure (b). My expression works fine, but there is a massive performance overhead. &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;IF(GetCurrentSelections()&lt;SPAN style="font-size: 10pt;"&gt;, = 'month', &lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;&amp;nbsp; sum({1 &amp;lt;cytd_flag = {1}, [currency to]=&amp;gt;} [quantity activities]), /* Measure (a)*/&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;cytd_flag = {1}, [currency to]=&amp;gt;} [quantity calls]))&amp;nbsp; /* Measure (b)*/&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Any suggestions to achieve the same result?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Dynamic Measure on GetCurrentSelections</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Measure-on-GetCurrentSelections/m-p/1201618#M875641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Hi All,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;I am looking to have a dynamic measure in a chart based on a current selection on a dimension.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;In my example, I want it to give me measure (a) if I select the dimension 'month', and if 'month' is not selected, give me measure (b). My expression works fine, but there is a massive performance overhead. &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;IF(GetCurrentSelections()&lt;SPAN style="font-size: 10pt;"&gt;, = 'month', &lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;&amp;nbsp; sum({1 &amp;lt;cytd_flag = {1}, [currency to]=&amp;gt;} [quantity activities]), /* Measure (a)*/&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;cytd_flag = {1}, [currency to]=&amp;gt;} [quantity calls]))&amp;nbsp; /* Measure (b)*/&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Any suggestions to achieve the same result?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Measure-on-GetCurrentSelections/m-p/1201618#M875641</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measure on GetCurrentSelections</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Measure-on-GetCurrentSelections/m-p/1201619#M875642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christopher, maybe using the field instead of the general 'GetCurrentSelction()':&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;IF(DimensionFieldName&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt; = 'month',&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you can try if the conditional expressions gives better performance, create both expressions and opposed conditions like:&lt;/P&gt;&lt;P&gt;- For measure (a):&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;DimensionFieldName&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt; = 'month'&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #3d3d3d; font-size: 10pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #3d3d3d; font-size: 10pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;-For measure (b)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; DimensionFieldName&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt; &amp;lt;&amp;gt; 'month'&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #3d3d3d; font-size: 10pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;And if you're using dimension groups check this post on how to detect the actual dimension:&lt;/SPAN&gt;&lt;EM style="color: #3d3d3d; font-size: 10pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt; &lt;A href="https://community.qlik.com/docs/DOC-14514"&gt;Did you know..? Cyclic Group&lt;/A&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 13:47:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Measure-on-GetCurrentSelections/m-p/1201619#M875642</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2016-10-31T13:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measure on GetCurrentSelections</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Measure-on-GetCurrentSelections/m-p/1201620#M875643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the fieldname, I will then be getting the values within the field. I.e. [month] = 'Jan, Feb, Mar'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, with a bit of tweaking, I've used the following and it works much better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( match([month],'Jan',' Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;cytd_flag = {1}, [currency to]=&amp;gt;} [quantity activities]), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({ 1 &amp;lt;cytd_flag = {1}, [currency to]=&amp;gt;} [quantity &lt;EM style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;calls&lt;/EM&gt;])&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 14:05:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Measure-on-GetCurrentSelections/m-p/1201620#M875643</guid>
      <dc:creator />
      <dc:date>2016-10-31T14:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Measure on GetCurrentSelections</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Measure-on-GetCurrentSelections/m-p/1201621#M875644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christopher, if you want to check any values directly selected on a field you can try with GetSelectedCount():&lt;/P&gt;&lt;P&gt;GetSelectedCount(Month) // If no value is selected in the field returns 0, wich is equal to False.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if (&lt;SPAN style="font-size: 13.3333px;"&gt;GetSelectedCount(Month)&lt;/SPAN&gt;,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;cytd_flag = {1}, [currency to]=&amp;gt;} [quantity activities]),&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({ 1 &amp;lt;cytd_flag = {1}, [currency to]=&amp;gt;} [quantity &lt;SPAN style="font-weight: inherit; font-size: 13.3333px;"&gt;&lt;EM&gt;calls&lt;/EM&gt;&lt;/SPAN&gt;])&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Note that it will also return true when there is more than one value selected&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 14:11:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Measure-on-GetCurrentSelections/m-p/1201621#M875644</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2016-10-31T14:11:00Z</dc:date>
    </item>
  </channel>
</rss>

