<?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: Hide object based on current selection in a specific field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Hide-object-based-on-current-selection-in-a-specific-field/m-p/1191017#M884399</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=GetSelectedCount(FieldB) = 1&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Sep 2016 15:27:12 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-09-23T15:27:12Z</dc:date>
    <item>
      <title>Hide object based on current selection in a specific field</title>
      <link>https://community.qlik.com/t5/QlikView/Hide-object-based-on-current-selection-in-a-specific-field/m-p/1191015#M884397</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 style="font-family: Calibri; font-size: 11pt;"&gt;I'm trying to hide a sheet object unless a single selection is made in a specific field.&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11pt;"&gt;If I have 3 fields: FieldA, FieldB and FieldC, I want to display an object if FieldB only has a single selection and hide the object if FieldB has 0 or 2+ selections. It does not matter what is selected in FieldB, only the quantity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11pt;"&gt;I am falling at the first hurdle which I think is to extract the selection for the field from the GetCurrentSelection() function. I came up with the following:&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11pt;"&gt;=TextBetween(GetCurrentSelections(),'FieldB: ',chr(13),)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11pt;"&gt;This works providing FieldB is not the last selection, because the selections in the GetCurrentSelection are separated by a CR. But if FieldB is the last selection there is no CR at the end of the string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11pt;"&gt;If someone knows an easy way to do this I would be really pleased, otherwise I need to extract the field selection from the GetCurrentSelection() result in the following circumstances:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No FieldB selection&lt;/P&gt;&lt;P&gt;FieldA: 1,2,3&lt;/P&gt;&lt;P&gt;FieldC: A,B,C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only FieldB selection:&lt;/P&gt;&lt;P&gt;FieldB: first, second, third&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FieldB is the first selection:&lt;/P&gt;&lt;P&gt;FieldB: first, second, third&lt;/P&gt;&lt;P&gt;FieldC: A,B,C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FieldB is the last selection:&lt;/P&gt;&lt;P&gt;FieldA: 1,2,3&lt;/P&gt;&lt;P&gt;FieldC: A,B,C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping there is an easy way to do this without a complicated nested if statement.&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>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hide-object-based-on-current-selection-in-a-specific-field/m-p/1191015#M884397</guid>
      <dc:creator>ianwilson</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Hide object based on current selection in a specific field</title>
      <link>https://community.qlik.com/t5/QlikView/Hide-object-based-on-current-selection-in-a-specific-field/m-p/1191016#M884398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got this working with the following statement: If there is only 1 item selected in FieldB this returns the value of the selection in FieldB, otherwise it returns a 0. Surely there is a better, more elegant, faster performing way than this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=If(if(substringcount(GetCurrentSelections(),'FieldB: ')=1,if(findoneof(TextBetween(GetCurrentSelections(),'FieldB: ',''),chr(13),)=0,TextBetween(GetCurrentSelections(),'FieldB: ',,),TextBetween(GetCurrentSelections(),'FieldB: ',chr(13),),),0)=0,0,If(if(substringcount(GetCurrentSelections(),'FieldB: ')=1,if(findoneof(TextBetween(GetCurrentSelections(),'FieldB: ',''),chr(13),)=0,TextBetween(GetCurrentSelections(),'FieldB: ',,),TextBetween(GetCurrentSelections(),'FieldB: ',chr(13),),),0)='-',0,if(findoneof(if(substringcount(GetCurrentSelections(),'FieldB: ')=1,if(findoneof(TextBetween(GetCurrentSelections(),'FieldB: ',''),chr(13),)=0,TextBetween(GetCurrentSelections(),'FieldB: ',,),TextBetween(GetCurrentSelections(),'FieldB: ',chr(13),),),0),chr(44),)&amp;gt;=1,0,if(substringcount(GetCurrentSelections(),'FieldB: ')=1,if(findoneof(TextBetween(GetCurrentSelections(),'FieldB: ',''),chr(13),)=0,TextBetween(GetCurrentSelections(),'FieldB: ',,),TextBetween(GetCurrentSelections(),'FieldB: ',chr(13),),),0))))&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>Fri, 23 Sep 2016 13:38:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hide-object-based-on-current-selection-in-a-specific-field/m-p/1191016#M884398</guid>
      <dc:creator>ianwilson</dc:creator>
      <dc:date>2016-09-23T13:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Hide object based on current selection in a specific field</title>
      <link>https://community.qlik.com/t5/QlikView/Hide-object-based-on-current-selection-in-a-specific-field/m-p/1191017#M884399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=GetSelectedCount(FieldB) = 1&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2016 15:27:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hide-object-based-on-current-selection-in-a-specific-field/m-p/1191017#M884399</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-23T15:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Hide object based on current selection in a specific field</title>
      <link>https://community.qlik.com/t5/QlikView/Hide-object-based-on-current-selection-in-a-specific-field/m-p/1191018#M884400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Spot on &lt;A _jive_internal="true" href="https://community.qlik.com/people/stalwar1"&gt;Sunny T&lt;/A&gt; - thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I couldn't believe there wasn't an easy way of doing this. Guess I need to refine my search techniques!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Sep 2016 15:34:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hide-object-based-on-current-selection-in-a-specific-field/m-p/1191018#M884400</guid>
      <dc:creator>ianwilson</dc:creator>
      <dc:date>2016-09-23T15:34:42Z</dc:date>
    </item>
  </channel>
</rss>

