<?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: Using an expression to find if a variable value exists in a table field in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839803#M69513</link>
    <description>&lt;P&gt;put single quotes around.&amp;nbsp; and make sure vUser starts with an = sign.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=if(count({&amp;lt;UID={'$(vUser)'}&amp;gt;} UID)&amp;gt;0,1,0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if it doesn't begin with equal sign try this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=if(count({&amp;lt;UID={'$(=$(vUser))'}&amp;gt;} UID)&amp;gt;0,1,0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Sep 2021 14:26:10 GMT</pubDate>
    <dc:creator>stevejoyce</dc:creator>
    <dc:date>2021-09-28T14:26:10Z</dc:date>
    <item>
      <title>Using an expression to find if a variable value exists in a table field</title>
      <link>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839763#M69506</link>
      <description>&lt;P&gt;Hopefull this makes sense. I want to set a variable value to 1 or 0 based of if another variable value is found in a table. For example if I have a variable set to a username how do I then set my other variable to 1 or 0 based on whether that username exists in a table of usernames I have loaded in?&lt;/P&gt;&lt;P&gt;in laymans terms&lt;/P&gt;&lt;P&gt;if table contains username then set another variable to 1.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 13:39:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839763#M69506</guid>
      <dc:creator>neil-devlin</dc:creator>
      <dc:date>2021-09-28T13:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using an expression to find if a variable value exists in a table field</title>
      <link>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839768#M69507</link>
      <description>&lt;P&gt;I may not understand correctly but you can load a 2nd table with a where clause and then count number of rows.&lt;/P&gt;&lt;P&gt;let vUserName = 'steve';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;load * inline [&lt;/P&gt;&lt;P&gt;username&lt;/P&gt;&lt;P&gt;joe&lt;/P&gt;&lt;P&gt;steve&lt;/P&gt;&lt;P&gt;chris&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;check_steve_exists:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;1 as steve_exists&lt;/P&gt;&lt;P&gt;resident data&lt;/P&gt;&lt;P&gt;where username = '$(vUserName )';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let vSteveExists = if(NoOfRows('check_steve_exists')&amp;gt;0, 1, 0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;drop table&amp;nbsp;check_steve_exists;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 13:43:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839768#M69507</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-09-28T13:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using an expression to find if a variable value exists in a table field</title>
      <link>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839770#M69509</link>
      <description>&lt;P&gt;Hey thanks but I need to do this in an expression to set a variable rather than when I am doing the intial load script as I cant set the first variable (username) until the cube is opened and I can determine it via OSUSER().&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 13:46:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839770#M69509</guid>
      <dc:creator>neil-devlin</dc:creator>
      <dc:date>2021-09-28T13:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using an expression to find if a variable value exists in a table field</title>
      <link>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839776#M69510</link>
      <description>&lt;P&gt;ok.&amp;nbsp; so how about this then:&lt;/P&gt;&lt;P&gt;=count({&amp;lt;username = {'$(=osuser())'} &amp;gt;} username)&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 13:48:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839776#M69510</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-09-28T13:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using an expression to find if a variable value exists in a table field</title>
      <link>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839791#M69511</link>
      <description>&lt;P&gt;Unfortunately if I integrate this into my expression the variable just becomes NULL,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=if(count({&amp;lt;UID={$(vUser)}&amp;gt;} UID)&amp;gt;0,1,0)&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 14:06:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839791#M69511</guid>
      <dc:creator>neil-devlin</dc:creator>
      <dc:date>2021-09-28T14:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using an expression to find if a variable value exists in a table field</title>
      <link>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839803#M69513</link>
      <description>&lt;P&gt;put single quotes around.&amp;nbsp; and make sure vUser starts with an = sign.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=if(count({&amp;lt;UID={'$(vUser)'}&amp;gt;} UID)&amp;gt;0,1,0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if it doesn't begin with equal sign try this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=if(count({&amp;lt;UID={'$(=$(vUser))'}&amp;gt;} UID)&amp;gt;0,1,0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 14:26:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839803#M69513</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-09-28T14:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using an expression to find if a variable value exists in a table field</title>
      <link>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839806#M69514</link>
      <description>&lt;P&gt;Brilliant, that did the trick! Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 14:32:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-an-expression-to-find-if-a-variable-value-exists-in-a/m-p/1839806#M69514</guid>
      <dc:creator>neil-devlin</dc:creator>
      <dc:date>2021-09-28T14:32:35Z</dc:date>
    </item>
  </channel>
</rss>

