<?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 Set and call variable in an if statement in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-and-call-variable-in-an-if-statement/m-p/2061478#M87076</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I thought this would be pretty easy, but somehow I am stuck. I want to be able to select the desired vVariante by simple removing the comment in order to switch&amp;nbsp;between RealLife, Prototyp and Version 1. And then the variables&amp;nbsp;vZahlungen and&amp;nbsp;vGebühren shall be set so that I can use the correct ones when loading my files. Nevertheless it does not work. When I create a textbox with $(vVariante ) it is empty.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;//Set vVariante = 'RealLife';&lt;BR /&gt;Set vVariante = 'Prototyp';&lt;BR /&gt;//Set vVariante = 'Version 1';&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If $(vVariante) = 'RealLife' Then &lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set vZahlungen = 'Zahlungen'; &lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set vGebühren = 'Gebühren';&lt;BR /&gt;ElseIf $(vVariante) = 'Prototyp' Then &lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set vZahlungen = 'Zahlungen Prototyp'; &lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set vGebühren = 'Gebühren Prototyp';&lt;BR /&gt;ElseIf $(vVariante) = 'Version 1' Then&lt;BR /&gt;&amp;nbsp; Set vZahlungen = 'Zahlungen Var 1' ;&lt;BR /&gt;&amp;nbsp; Set vGebühren = 'Gebühren';&lt;BR /&gt;Else &lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set vZahlungen = 'not available' ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set vGebühren = 'not available';&lt;BR /&gt;End If;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do I do wrong?? Thank you&lt;/P&gt;</description>
    <pubDate>Tue, 18 Apr 2023 10:26:51 GMT</pubDate>
    <dc:creator>NihalCakir</dc:creator>
    <dc:date>2023-04-18T10:26:51Z</dc:date>
    <item>
      <title>Set and call variable in an if statement</title>
      <link>https://community.qlik.com/t5/App-Development/Set-and-call-variable-in-an-if-statement/m-p/2061478#M87076</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I thought this would be pretty easy, but somehow I am stuck. I want to be able to select the desired vVariante by simple removing the comment in order to switch&amp;nbsp;between RealLife, Prototyp and Version 1. And then the variables&amp;nbsp;vZahlungen and&amp;nbsp;vGebühren shall be set so that I can use the correct ones when loading my files. Nevertheless it does not work. When I create a textbox with $(vVariante ) it is empty.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;//Set vVariante = 'RealLife';&lt;BR /&gt;Set vVariante = 'Prototyp';&lt;BR /&gt;//Set vVariante = 'Version 1';&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If $(vVariante) = 'RealLife' Then &lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set vZahlungen = 'Zahlungen'; &lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set vGebühren = 'Gebühren';&lt;BR /&gt;ElseIf $(vVariante) = 'Prototyp' Then &lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set vZahlungen = 'Zahlungen Prototyp'; &lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set vGebühren = 'Gebühren Prototyp';&lt;BR /&gt;ElseIf $(vVariante) = 'Version 1' Then&lt;BR /&gt;&amp;nbsp; Set vZahlungen = 'Zahlungen Var 1' ;&lt;BR /&gt;&amp;nbsp; Set vGebühren = 'Gebühren';&lt;BR /&gt;Else &lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set vZahlungen = 'not available' ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Set vGebühren = 'not available';&lt;BR /&gt;End If;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do I do wrong?? Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 10:26:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-and-call-variable-in-an-if-statement/m-p/2061478#M87076</guid>
      <dc:creator>NihalCakir</dc:creator>
      <dc:date>2023-04-18T10:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set and call variable in an if statement</title>
      <link>https://community.qlik.com/t5/App-Development/Set-and-call-variable-in-an-if-statement/m-p/2061488#M87078</link>
      <description>&lt;P&gt;//Set vVariante = 'RealLife';&lt;BR /&gt;Set vVariante = 'Prototyp';&lt;BR /&gt;//Set vVariante = 'Version 1';&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If '$(vVariante)' = 'RealLife' Then&lt;BR /&gt;Set vZahlungen = 'Zahlungen';&lt;BR /&gt;Set vGebühren = 'Gebühren';&lt;BR /&gt;ElseIf '$(vVariante)' = 'Prototyp' Then&lt;BR /&gt;Set vZahlungen = 'Zahlungen Prototyp';&lt;BR /&gt;Set vGebühren = 'Gebühren Prototyp';&lt;BR /&gt;ElseIf '$(vVariante)' = 'Version 1' Then&lt;BR /&gt;Set vZahlungen = 'Zahlungen Var 1' ;&lt;BR /&gt;Set vGebühren = 'Gebühren';&lt;BR /&gt;Else&lt;BR /&gt;Set vZahlungen = 'not available' ;&lt;BR /&gt;Set vGebühren = 'not available';&lt;BR /&gt;End If;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should be referencing the variable encased in quotes so it is used as a string. I recommend using Debug mode to test this sort of thing:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Or_0-1681814872459.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/105147i6CA1F1CC1A3F6441/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Or_0-1681814872459.png" alt="Or_0-1681814872459.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 10:48:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-and-call-variable-in-an-if-statement/m-p/2061488#M87078</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2023-04-18T10:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Set and call variable in an if statement</title>
      <link>https://community.qlik.com/t5/App-Development/Set-and-call-variable-in-an-if-statement/m-p/2061534#M87081</link>
      <description>&lt;P&gt;Hi, &lt;SPAN&gt;referencing the variable encased in quotes was doing the trick. I tried debug mode but and saw that the variable was not set but couldn't understand why. Thank you for your help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 12:38:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-and-call-variable-in-an-if-statement/m-p/2061534#M87081</guid>
      <dc:creator>NihalCakir</dc:creator>
      <dc:date>2023-04-18T12:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set and call variable in an if statement</title>
      <link>https://community.qlik.com/t5/App-Development/Set-and-call-variable-in-an-if-statement/m-p/2061538#M87083</link>
      <description>&lt;P&gt;I've made this mistake more than a few times in the past, so I've learned to notice the color highlighting here as an immediate "This is acting like a field instead of a string" telltale.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 12:42:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-and-call-variable-in-an-if-statement/m-p/2061538#M87083</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2023-04-18T12:42:06Z</dc:date>
    </item>
  </channel>
</rss>

