<?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: help with set analysis and function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/help-with-set-analysis-and-function/m-p/119626#M8308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;[Comp Name]={"$(=SubField(GetFieldSelections([Comp Name], '@'), '@', 2))"}&amp;gt;} Amount)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue was that your Comp Name included comma in the name which confused the SubField function. In order to fix this, I changed the delimiter for GetFieldSelections to @ (you can change this to anything which won't occur in the Comp Name field) and then used SubField with @.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/210377_Capture.PNG" style="height: 334px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Aug 2018 10:36:10 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-08-09T10:36:10Z</dc:date>
    <item>
      <title>help with set analysis and function</title>
      <link>https://community.qlik.com/t5/App-Development/help-with-set-analysis-and-function/m-p/119623#M8305</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;I use this function to get the 2nd selected value of field [Comp Name]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;subfield(GetFieldSelections([Comp Name]),',',2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to sum 'Amount' only of 2nd selected value, so I wrote this expression using set analysis:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;[Comp Name]={'$(=SubField(GetFieldSelections([Comp Name]) ,',',2))'}&amp;gt;} Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it doesn't work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same function with first selected value seems to work fine, I can't understand why&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;[Comp Name]={'$(=SubField(GetFieldSelections([Comp Name]) ,',',1))'}&amp;gt;} Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I also tried to create a variable $(vSelComp2) that contains function subfield(GetFieldSelections([Comp Name]),',',2)&lt;/P&gt;&lt;P&gt;to use in this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;&lt;BR /&gt;[Comp Name]={$(vSelComp2)}&lt;/P&gt;&lt;P&gt;&amp;gt;} Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it doesn't work either. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to sum amount of 2nd, 3rd, ... selected value only, but I can't get this to work. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 12:59:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/help-with-set-analysis-and-function/m-p/119623#M8305</guid>
      <dc:creator>josemaria_cabre</dc:creator>
      <dc:date>2018-08-08T12:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis and function</title>
      <link>https://community.qlik.com/t5/App-Development/help-with-set-analysis-and-function/m-p/119624#M8306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share a sample which shows the issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 16:38:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/help-with-set-analysis-and-function/m-p/119624#M8306</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-08-08T16:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis and function</title>
      <link>https://community.qlik.com/t5/App-Development/help-with-set-analysis-and-function/m-p/119625#M8307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure. I did this sample .qvf, hope it helps. You need to select (at least) 2 companies at Comp Name filter. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 17:38:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/help-with-set-analysis-and-function/m-p/119625#M8307</guid>
      <dc:creator>josemaria_cabre</dc:creator>
      <dc:date>2018-08-08T17:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis and function</title>
      <link>https://community.qlik.com/t5/App-Development/help-with-set-analysis-and-function/m-p/119626#M8308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;[Comp Name]={"$(=SubField(GetFieldSelections([Comp Name], '@'), '@', 2))"}&amp;gt;} Amount)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue was that your Comp Name included comma in the name which confused the SubField function. In order to fix this, I changed the delimiter for GetFieldSelections to @ (you can change this to anything which won't occur in the Comp Name field) and then used SubField with @.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/210377_Capture.PNG" style="height: 334px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 10:36:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/help-with-set-analysis-and-function/m-p/119626#M8308</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-08-09T10:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: help with set analysis and function</title>
      <link>https://community.qlik.com/t5/App-Development/help-with-set-analysis-and-function/m-p/119627#M8309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works great now. Thank you very much Sunny!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 10:49:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/help-with-set-analysis-and-function/m-p/119627#M8309</guid>
      <dc:creator>josemaria_cabre</dc:creator>
      <dc:date>2018-08-09T10:49:27Z</dc:date>
    </item>
  </channel>
</rss>

