<?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: Return a matched field value by second field Selection/Value as string? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Return-a-matched-field-value-by-second-field-Selection-Value-as/m-p/873498#M1005364</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, it look like the ONLY function might fit this need, based on the article: &lt;A href="https://community.qlik.com/thread/23994"&gt;Use of ONLY Function&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Found this after posting the question, but I will leave this open until I am able to test that this function works sufficiently for my needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: This does the trick!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Updated variables with testing code follows:&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;&lt;BR /&gt;&lt;/SPAN&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;vReturnedUserRole = ONLY({&amp;lt;User = P(User)&amp;gt;}UserRole)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vReturnedUserRep = ONLY({&amp;lt;User = P(User)&amp;gt;}Rep)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Now I only need to replace P(User) with the result of QVUser() (supplied by our SSO) and I'll be in business!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;FINAL EDIT:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Switched to OSUser() for the user string due to some misunderstanding about QVUser only supplying Section Access authenticated user info.&amp;nbsp; Marking as Solved.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 May 2015 22:22:24 GMT</pubDate>
    <dc:creator>ryaneverts</dc:creator>
    <dc:date>2015-05-28T22:22:24Z</dc:date>
    <item>
      <title>Return a matched field value by second field Selection/Value as string?</title>
      <link>https://community.qlik.com/t5/QlikView/Return-a-matched-field-value-by-second-field-Selection-Value-as/m-p/873497#M1005363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Qlik Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally I would use set analysis or a match or Lookup function to get this done, but this is kind of an odd situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a user has a role of standard user, I want to only show data in a straight chart for their corresponding rep name.&amp;nbsp; If the user has a role of Manager, I want them to be able to see the data for all reps.&amp;nbsp; Section access has already been ruled out in favor of a calculated dimension for this scenario, as only a small subset of data can be hidden without problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For context: a simplified version of our Data Model looks something the following, with a facts and users table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="74" style="border: 1px solid #000000; width: 166px; height: 69px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Facts&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;Rep&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Data to selectively hide&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE border="1" class="jiveBorder" height="124" style="border: 1px solid #000000; width: 170px; height: 84px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;P&gt;Users&lt;/P&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Rep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;User&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;UserRole&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need to know is: Is there an existing function like match or lookup that, based off of a known User value, can return the corresponding User Role as a string?&amp;nbsp; Each User will only exist once on the Users table and will have a corresponding role of either User or Manager. The code for the calculated dimension will need to look something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF( $(vReturnedUserRole)='Manager',&lt;/P&gt;&lt;P&gt;Rep,&lt;/P&gt;&lt;P&gt;IF(Rep = $(vReturnedUserRep),&lt;/P&gt;&lt;P&gt;Rep,&lt;/P&gt;&lt;P&gt;Null()&lt;/P&gt;&lt;P&gt;))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining the variables in pseudocode as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vReturnedUserRole = For known User, return matching User Role as string&lt;/P&gt;&lt;P&gt;vReturnedUserRep = For known User, return matching Rep as string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And would be followed by suppressing null values for the calculated dimension.&amp;nbsp; Let me know if I am going a wrong direction on this or if the approach would be too CPU-intensive.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 22:08:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-a-matched-field-value-by-second-field-Selection-Value-as/m-p/873497#M1005363</guid>
      <dc:creator>ryaneverts</dc:creator>
      <dc:date>2015-05-28T22:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Return a matched field value by second field Selection/Value as string?</title>
      <link>https://community.qlik.com/t5/QlikView/Return-a-matched-field-value-by-second-field-Selection-Value-as/m-p/873498#M1005364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, it look like the ONLY function might fit this need, based on the article: &lt;A href="https://community.qlik.com/thread/23994"&gt;Use of ONLY Function&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Found this after posting the question, but I will leave this open until I am able to test that this function works sufficiently for my needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: This does the trick!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Updated variables with testing code follows:&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;&lt;BR /&gt;&lt;/SPAN&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;vReturnedUserRole = ONLY({&amp;lt;User = P(User)&amp;gt;}UserRole)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vReturnedUserRep = ONLY({&amp;lt;User = P(User)&amp;gt;}Rep)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Now I only need to replace P(User) with the result of QVUser() (supplied by our SSO) and I'll be in business!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;FINAL EDIT:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Switched to OSUser() for the user string due to some misunderstanding about QVUser only supplying Section Access authenticated user info.&amp;nbsp; Marking as Solved.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 22:22:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-a-matched-field-value-by-second-field-Selection-Value-as/m-p/873498#M1005364</guid>
      <dc:creator>ryaneverts</dc:creator>
      <dc:date>2015-05-28T22:22:24Z</dc:date>
    </item>
  </channel>
</rss>

