<?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: changing messure formula dynamically in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833092#M11461</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply! &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;But maybe I described my actual pattern too simple. In reality I have not only one switch but many, and the formula of the messure needs to include the respective values of all the other switch variables too. So I can not determine the argument for calling the pick function in that moment, without knowing the actual values of the other switches. Is there no possibility for scripting the functional content of that messure outside of that diagram function syntax?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 May 2015 07:27:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-05-13T07:27:35Z</dc:date>
    <item>
      <title>changing messure formula dynamically</title>
      <link>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833090#M11459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my Qlik Sense Desktop app I use a messure, whose formula should change depending on the state of a switch&lt;SPAN style="font-size: 13.3333330154419px;"&gt; (extension "VariableButton"). The switch can be connected to a variable (i.e. vSwitch_on_off). &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Fortunately it is very easy to &lt;/SPAN&gt;change &lt;SPAN style="font-size: 13.3333330154419px;"&gt;the value of that switch &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;("on" or "off" / 1 or 0)&lt;/SPAN&gt; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;each other&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; &lt;/SPAN&gt;in the field "Button value 1":&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;=IF(vSwitch_on_off = 0, 1, 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to create a second variable v&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Messure&lt;/SPAN&gt; in my script, whose value would change depending on the &lt;SPAN style="font-size: 13.3333330154419px;"&gt;state of that &lt;/SPAN&gt;switch. This variable could dynamically evaluate in my app calling the &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;syntax $(vMessure).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, my Problem is: How is the syntax for that part of the script, where&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; I have to assign the formula to the &lt;SPAN style="font-size: 13.3333330154419px;"&gt;messure&lt;/SPAN&gt; variable? &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I tried this, but without success:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub &lt;SPAN style="font-size: 13.3333330154419px;"&gt;create_&lt;SPAN style="font-size: 13.3333330154419px;"&gt;messure&lt;/SPAN&gt;_formula (&lt;SPAN style="font-size: 13.3333330154419px;"&gt;vSwitch_state&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if &lt;SPAN style="font-size: 13.3333330154419px;"&gt;vSwitch_state&lt;/SPAN&gt; = 0 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; v&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Messure&lt;/SPAN&gt; = field1&lt;/P&gt;&lt;P&gt;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;v&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Messure&lt;/SPAN&gt; = field2&lt;/P&gt;&lt;P&gt;&amp;nbsp; endif&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;LET &lt;SPAN style="font-size: 13.3333330154419px;"&gt;v&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Messure&lt;/SPAN&gt; = 'call &lt;SPAN style="font-size: 13.3333330154419px;"&gt;create_m&lt;SPAN style="font-size: 13.3333330154419px;"&gt;essure&lt;/SPAN&gt;_formula&lt;/SPAN&gt; (vSwitch_on_off)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;How to get ready? &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Any help is appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 12:20:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833090#M11459</guid>
      <dc:creator />
      <dc:date>2015-05-11T12:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: changing messure formula dynamically</title>
      <link>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833091#M11460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try an expression like: pick($(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vSwitch_on_off&lt;/SPAN&gt;)+1, field1, field2)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 15:59:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833091#M11460</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-05-11T15:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: changing messure formula dynamically</title>
      <link>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833092#M11461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your reply! &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;But maybe I described my actual pattern too simple. In reality I have not only one switch but many, and the formula of the messure needs to include the respective values of all the other switch variables too. So I can not determine the argument for calling the pick function in that moment, without knowing the actual values of the other switches. Is there no possibility for scripting the functional content of that messure outside of that diagram function syntax?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 07:27:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833092#M11461</guid>
      <dc:creator />
      <dc:date>2015-05-13T07:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: changing messure formula dynamically</title>
      <link>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833093#M11462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps this discussion helps: &lt;A href="https://community.qlik.com/message/765915"&gt;Re: Using Edit Module Functions in Pivot Table Expression&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 07:50:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833093#M11462</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-05-13T07:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: changing messure formula dynamically</title>
      <link>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833094#M11463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, but to be honest, I don't see, how could this be helpful to me. Is it the easter egg you will recommend to me? Is there such one in Qlik Sense too, but where? Otherwise: If I shall use my switch variables in the way, I call the pick function, unfortunately there seems to be a limitation with the allowed nestings for the IF-function, that I would have to include in my case. In tests I could see, that only a complexity of 9 nesting IFs would work. Actually I would need 12. And on the other hand this syntax structure would not solve all my usability problems, because I need more scripting logics to rule the values of the other switch variables at the same time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 11:21:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833094#M11463</guid>
      <dc:creator />
      <dc:date>2015-05-13T11:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: changing messure formula dynamically</title>
      <link>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833095#M11464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, not the easter egg setting. I was thinking of variables containing expressions and nesting these where necessary to build up the logic tree you need. You'd have to do all this in the load script since there's currently not an expression editor for Qlik Sense.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 11:28:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833095#M11464</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-05-13T11:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: changing messure formula dynamically</title>
      <link>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833096#M11465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, that exactly was my point too: I already tried out &lt;SPAN style="font-size: 13.3333330154419px;"&gt;that &lt;/SPAN&gt;in the load script, but found no way&lt;SPAN style="font-size: 13.3333330154419px;"&gt; in order to assign my complex script logics to the actions, that were triggerd within the sheets. For that in my opinion it will not be sufficient, only to change single variables, because I need to change more than only one variable on one single action.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;Therfore could you please make a very simple example, how can I call a sub from a switch&lt;SPAN style="font-size: 13.3333330154419px;"&gt; (extension "VariableButton") within my sheet&lt;/SPAN&gt;, in order to execute several operations? Or is there &lt;SPAN style="font-size: 13.3333330154419px;"&gt;needed &lt;/SPAN&gt;any different approach?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;Thanks in advance and best regards!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2015 14:22:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/changing-messure-formula-dynamically/m-p/833096#M11465</guid>
      <dc:creator />
      <dc:date>2015-05-13T14:22:39Z</dc:date>
    </item>
  </channel>
</rss>

