<?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: If statement with variable won't work in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141008#M20979</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If( &lt;STRONG&gt;&lt;EM&gt;$(vBenutzer)&lt;/EM&gt;&lt;/STRONG&gt; = 'XXX', 'EN', 'DE')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Oct 2018 17:52:12 GMT</pubDate>
    <dc:creator>vishsaggi</dc:creator>
    <dc:date>2018-10-08T17:52:12Z</dc:date>
    <item>
      <title>If statement with variable won't work</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141007#M20978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello specialists,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help for a coding problem that I'm not understanding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my script I query the actual user with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vBenutzer = QVUser();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I like to decide with a "IF" statement which text a second variable should have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(vBenutzer = 'XXX', 'EN', 'DE') as Language;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried many versions of the "IF" statements but nothing works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please can every specialist give me support?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2018 13:17:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141007#M20978</guid>
      <dc:creator>michael_luettge</dc:creator>
      <dc:date>2018-10-08T13:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with variable won't work</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141008#M20979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If( &lt;STRONG&gt;&lt;EM&gt;$(vBenutzer)&lt;/EM&gt;&lt;/STRONG&gt; = 'XXX', 'EN', 'DE')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2018 17:52:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141008#M20979</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2018-10-08T17:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with variable won't work</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141009#M20980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, but won't work. I receive the message "Error in Expression" if I change the statement to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If( $(vBenutzer) = 'XXX', 'EN', 'DE') as Language;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The cursor indicates the " , " as the problem and I don't understand why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give an advise?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 06:00:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141009#M20980</guid>
      <dc:creator>michael_luettge</dc:creator>
      <dc:date>2018-10-09T06:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with variable won't work</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141010#M20981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please post your script once.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 06:19:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141010#M20981</guid>
      <dc:creator>chinnuchinni</dc:creator>
      <dc:date>2018-10-09T06:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with variable won't work</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141011#M20982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it's a short script until now. I like to check which user has opened the application. Then I like to decide in which&lt;/P&gt;&lt;P&gt;language should Qlikview shows the titles of the tables. But the script shows me an error in the first "if" statement&lt;/P&gt;&lt;P&gt;and indicates that the " , " should be the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vBenutzer = QVUser();&lt;/P&gt;&lt;P&gt;If( $(vBenutzer) = 'XXX'&lt;STRONG&gt;,&lt;/STRONG&gt; 'EN', 'DE') as Sprache;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Sprache = 'DE' then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET A1 = 'Title DE 1';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET A2 = 'Title DE 2';&lt;/P&gt;&lt;P&gt;end if;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;If Sprache = 'EN' then&lt;/P&gt;&lt;P style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET A1 = 'Title EN 1';&lt;/P&gt;&lt;P style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET A2 = 'Title EN 2';&lt;/P&gt;&lt;P style="color: #575757; font-family: arial,helvetica,sans-serif; font-size: 13.33px; font-style: normal; font-weight: 400; text-align: left; text-indent: 0px;"&gt;end if;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for every advise.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 06:38:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141011#M20982</guid>
      <dc:creator>michael_luettge</dc:creator>
      <dc:date>2018-10-09T06:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with variable won't work</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141012#M20983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have section access in the application? If not, you might have to use OSUser() instead of qvuser(). And the code you use need some correction as well, like:&lt;/P&gt;&lt;P&gt;&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;Let vBenutzer = QVUser();&amp;nbsp; //&lt;STRONG&gt; Or, OSUser()&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Let &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Sprache&lt;/STRONG&gt; =&lt;/SPAN&gt;If( &lt;STRONG&gt;vBenutzer&lt;/STRONG&gt; = 'XXX'&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/SPAN&gt; 'EN', 'DE') ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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 Sprache = 'DE' then&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; SET A1 = 'Title DE 1';&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; SET A2 = 'Title DE 2';&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;end if;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.33px;"&gt;If Sprache = 'EN' then&lt;/P&gt;&lt;P style="font-size: 13.33px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET A1 = 'Title EN 1';&lt;/P&gt;&lt;P style="font-size: 13.33px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET A2 = 'Title EN 2';&lt;/P&gt;&lt;P style="font-size: 13.33px;"&gt;end if;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 06:55:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141012#M20983</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2018-10-09T06:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with variable won't work</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141013#M20984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you a lot, that was the solution !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 07:05:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141013#M20984</guid>
      <dc:creator>michael_luettge</dc:creator>
      <dc:date>2018-10-09T07:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with variable won't work</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141014#M20985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your case the variable contains a string and therefore you need single-quotes around it by calling them, like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If('&lt;STRONG&gt;&lt;EM&gt;$(vBenutzer)'&lt;/EM&gt;&lt;/STRONG&gt; = 'XXX', 'EN', 'DE')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beside this I assume that you rather need osuser() instead of qvuser() which is only available if you used section access with USERID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further I suggest to consider to use the function directly instead of creating an additionally variable which adds here no value, maybe in this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(match(osuser(), 'User1', 'User2', ...), 'EN', 'DE')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Oct 2018 07:06:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-with-variable-won-t-work/m-p/141014#M20985</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-10-09T07:06:56Z</dc:date>
    </item>
  </channel>
</rss>

