<?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 Find a Value in a Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255797#M499367</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right. In the example above, you have two blank values that will share one position.&lt;/P&gt;&lt;P&gt;So FieldIndex('UserId','mtest') will return 5, while sun is in position 4 of the category field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that if you're getting into something more complex here it might be better to re-evaluate what you're trying to achieve with this? Maybe there's a more straight forward approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;With the table that you have in your latest example, you could use an expression like:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=MaxString({$&amp;lt;UserId={'mtest'}&amp;gt;} category)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would give you 'sun' as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jun 2011 03:28:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-06-01T03:28:09Z</dc:date>
    <item>
      <title>Find a Value in a Table</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255793#M499363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to find a value in a Table by passing the user login Id.&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Security:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;UserId,category&lt;/P&gt;&lt;P&gt;ntest,star&lt;/P&gt;&lt;P&gt;ktest,moon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have a table with fields UserId and category as shown above, I need to know the Category by passing the User Id. i am using below formula in a expression and it does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Fieldvalue('Security.category,FieldIndex('Security.UserId','ntest'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to find the Category of the user opening the qlikview application and would like to set some default selections for different fields.&amp;nbsp; Please suggest me how can i do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 22:47:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255793#M499363</guid>
      <dc:creator />
      <dc:date>2011-05-31T22:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Find a Value in a Table</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255794#M499364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Naveen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just looking at the expression you seem to have left out a ( ' ) after the Security.category. Wanted to make sure that this was not the issue.&lt;/P&gt;&lt;P&gt;Otherwise the approach looks ok to me. Also, are your fieldnames qualified? otherwise the name of them will be category and UserId instead of Security.category and Security.UserId.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, did a quick test, and it works fine here. Example attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 00:33:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255794#M499364</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-01T00:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Find a Value in a Table</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255795#M499365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Johannes. That was a typo error. I have it correct in my application. Actually it works with the given test data, but I have a table caled security that has about 600 rows of data and somehow i think the FieldIndex value that it retrieves is not correct, so that's why Field value returned by the expression is not correct value.. Do you think i need to sort the table or do anything on the table so that it returns correct FieldIndex value. I am loading this table from Oracle Database into Qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 02:16:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255795#M499365</guid>
      <dc:creator />
      <dc:date>2011-06-01T02:16:56Z</dc:date>
    </item>
    <item>
      <title>Find a Value in a Table</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255796#M499366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Please update your example with the below test data and you will understand my issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UserId, category&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ntest, star&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ktest, moon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dtest,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtest,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mtest,sun&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the below expression and it will not return "sun".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Fieldvalue('category',FieldIndex('UserId','mtest'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is happening because FieldIndex Value for mtest returns 5, whereas "sun" is at position 4 according to load order. Hope I had clearly explained my issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i return "sun" for mtest?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 03:04:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255796#M499366</guid>
      <dc:creator />
      <dc:date>2011-06-01T03:04:17Z</dc:date>
    </item>
    <item>
      <title>Find a Value in a Table</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255797#M499367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right. In the example above, you have two blank values that will share one position.&lt;/P&gt;&lt;P&gt;So FieldIndex('UserId','mtest') will return 5, while sun is in position 4 of the category field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that if you're getting into something more complex here it might be better to re-evaluate what you're trying to achieve with this? Maybe there's a more straight forward approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;With the table that you have in your latest example, you could use an expression like:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=MaxString({$&amp;lt;UserId={'mtest'}&amp;gt;} category)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would give you 'sun' as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 03:28:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255797#M499367</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-06-01T03:28:09Z</dc:date>
    </item>
    <item>
      <title>Find a Value in a Table</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255798#M499368</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;Take a resident of the table and make a new table as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿Load *,UserId&amp;amp;'_'&amp;amp;category as LinkField&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;resident A;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table A;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in the Expression &lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿Subfield(Fieldvalue('LinkField',fieldindex('UserID','mtest')),'_',2)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2011 03:32:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/255798#M499368</guid>
      <dc:creator>kaushalview</dc:creator>
      <dc:date>2011-06-01T03:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Find a Value in a Table</title>
      <link>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/2054764#M1223112</link>
      <description>&lt;P&gt;I tried using "Field value" ... the answer you need is "LookUp" !&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Eg&amp;nbsp;Referencing data ... USE lookUp !!&lt;BR /&gt;Let vLCT = Lookup('LAST_CHANGE_TIMESTAMP','TABLE_NAME','NATLOS','SYSVIEW');&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 15:30:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-a-Value-in-a-Table/m-p/2054764#M1223112</guid>
      <dc:creator>Andrew_Maynard1</dc:creator>
      <dc:date>2023-03-29T15:30:32Z</dc:date>
    </item>
  </channel>
</rss>

