<?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 subfield function with getselectedcount in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/subfield-function-with-getselectedcount/m-p/216684#M69983</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think John's on the right track. You just need to add some indirection using another variable.&lt;/P&gt;&lt;P&gt;SET vItemOpts = 'fieldname1;fieldname2;fieldname3';&lt;BR /&gt;SET vCurrOpt = 2;&lt;BR /&gt;SET vField = "=SubField(vItemOpts, ';', vCurrOpt)";&lt;/P&gt;&lt;P&gt;and then use the expression:&lt;/P&gt;&lt;P&gt;=GetSelectedCount($(vField))&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Apr 2010 01:33:31 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2010-04-17T01:33:31Z</dc:date>
    <item>
      <title>subfield function with getselectedcount</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-function-with-getselectedcount/m-p/216682#M69981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Where the variables have the following values:&lt;/P&gt;&lt;P&gt;vItemOpts = 'fieldname1;fieldname2;fieldname3'&lt;/P&gt;&lt;P&gt;vCurrOpt = 2&lt;/P&gt;&lt;P&gt;This expression in a text object returns the string 'fieldname2'&lt;/P&gt;&lt;P&gt;=SubField(vItemOpts, ';', vCurrOpt)&lt;/P&gt;&lt;P&gt;and where the field 'fieldname2' is used in a list box and has 1 value selected, this returns the value 1&lt;/P&gt;&lt;P&gt;=GetSelectedCount(fieldname2)&lt;/P&gt;&lt;P&gt;but this combination of the two returns null:&lt;/P&gt;&lt;P&gt;=GetSelectedCount(SubField(vItemOpts, ';', vCurrOpt))&lt;/P&gt;&lt;P&gt;Is this because GetSelectedCount sees the string 'SubField....' as a fieldname? How can I get around this?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Apr 2010 17:40:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-function-with-getselectedcount/m-p/216682#M69981</guid>
      <dc:creator />
      <dc:date>2010-04-16T17:40:46Z</dc:date>
    </item>
    <item>
      <title>subfield function with getselectedcount</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-function-with-getselectedcount/m-p/216683#M69982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subfield() returns a string, so your expression probably gets evaluated like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;=GetSelectedCount(SubField(vItemOpts, ';', vCurrOpt))&lt;BR /&gt;=GetSelectedCount('fieldname2')&lt;BR /&gt;=null (because you can't get selections for a string, only for a field, and it doesn't recognize it as a field)&lt;/P&gt;&lt;P&gt;I'm not thinking of how to tell it that you mean a field name instead of a string, assuming I even have the problem correct. There's got to be a way, though. Maybe something with dollar sign expansions, variables, or who knows what.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Apr 2010 21:49:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-function-with-getselectedcount/m-p/216683#M69982</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-16T21:49:11Z</dc:date>
    </item>
    <item>
      <title>subfield function with getselectedcount</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-function-with-getselectedcount/m-p/216684#M69983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think John's on the right track. You just need to add some indirection using another variable.&lt;/P&gt;&lt;P&gt;SET vItemOpts = 'fieldname1;fieldname2;fieldname3';&lt;BR /&gt;SET vCurrOpt = 2;&lt;BR /&gt;SET vField = "=SubField(vItemOpts, ';', vCurrOpt)";&lt;/P&gt;&lt;P&gt;and then use the expression:&lt;/P&gt;&lt;P&gt;=GetSelectedCount($(vField))&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Apr 2010 01:33:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-function-with-getselectedcount/m-p/216684#M69983</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2010-04-17T01:33:31Z</dc:date>
    </item>
    <item>
      <title>subfield function with getselectedcount</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-function-with-getselectedcount/m-p/216685#M69984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob, John - that cracked it!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Apr 2010 09:28:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-function-with-getselectedcount/m-p/216685#M69984</guid>
      <dc:creator />
      <dc:date>2010-04-19T09:28:01Z</dc:date>
    </item>
  </channel>
</rss>

