<?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 Get 1st, 2nd value of a Getfieldselections in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Get-1st-2nd-value-of-a-Getfieldselections/m-p/246183#M93832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that precision!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Aug 2011 14:29:33 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-08-03T14:29:33Z</dc:date>
    <item>
      <title>Get 1st, 2nd value of a Getfieldselections</title>
      <link>https://community.qlik.com/t5/QlikView/Get-1st-2nd-value-of-a-Getfieldselections/m-p/246179#M93828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to put the 1st, 2nd, ... value from a Getfieldselections to differents variables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Goal is to make a comparaison of those different selected values. Like This:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE bgcolor="#ffffff" border="1" cellpadding="0" cellspacing="0" style="font-size: 9pt;"&gt;&lt;TBODY&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TH bgcolor="#f5f5f5" nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;To date 31/07/2011&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;20050&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2210&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff" nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;1 Year&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;0,7415%&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;0,5829%&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff" nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;6 months&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;0,4694%&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;0,3784%&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff" nowrap="nowrap"&gt;&lt;P&gt;&lt;SPAN style="color: #363636;"&gt;3 months&lt;/SPAN&gt; &lt;/P&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;0,2825%&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;0,2226%&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;Year to date&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;0,5035%&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;0,4242%&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where 20050 is the 1st, 2210 the 2nd, ... (if more selected values)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And use the variable (v1)&amp;nbsp; for the column(1) in place of value "20050" and for column(2) the variable (v2) with the second value of the list. like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;=(&lt;/P&gt;&lt;P&gt;avg({1&amp;lt;NROTIT={$(v1)},DATE_VALEUR={"$(=Date(vDateRef))"}&amp;gt;} DERVALTIT)&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;if(Valuelist('1 Year','6 months','3 months','Year to date')='1 Year',top(sum({1&amp;lt;NROTIT={$(v1)},DATE_VALEUR={"$(=date(addmonths(vDateRef,-12)))"}&amp;gt;} DERVALTIT)),&lt;/P&gt;&lt;P&gt;if(Valuelist('1 Year','6 months','3 months','Year to date')='6 months',top(sum({1&amp;lt;NROTIT={$(v1)},DATE_VALEUR={"$(=date(addmonths(vDateRef,-6)))"}&amp;gt;} DERVALTIT)),&lt;/P&gt;&lt;P&gt;if(Valuelist('1 Year','6 months','3 months','Year to date')='3 months',top(sum({1&amp;lt;NROTIT={$(v1)},DATE_VALEUR={"$(=date(addmonths(vDateRef,-3)))"}&amp;gt;} DERVALTIT)),&lt;/P&gt;&lt;P&gt;if(Valuelist('1 Year','6 months','3 months','Year to date')='Year to date',top(sum({1&amp;lt;NROTIT={$(v1)},DATE_VALEUR={"$(=date(Yearstart(vDateRef)))"}&amp;gt;} DERVALTIT))&lt;/P&gt;&lt;P&gt;))))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;if(Valuelist('1 Year','6 months','3 months','Year to date')='1 Year',top(sum({1&amp;lt;NROTIT={$(v1)},DATE_VALEUR={"$(=date(addmonths(vDateRef,-12)))"}&amp;gt;} DERVALTIT)),&lt;/P&gt;&lt;P&gt;if(Valuelist('1 Year','6 months','3 months','Year to date')='6 months',top(sum({1&amp;lt;NROTIT={$(v1)},DATE_VALEUR={"$(=date(addmonths(vDateRef,-6)))"}&amp;gt;} DERVALTIT)),&lt;/P&gt;&lt;P&gt;if(Valuelist('1 Year','6 months','3 months','Year to date')='3 months',top(sum({1&amp;lt;NROTIT={$(v1)},DATE_VALEUR={"$(=date(addmonths(vDateRef,-3)))"}&amp;gt;} DERVALTIT)),&lt;/P&gt;&lt;P&gt;if(Valuelist('1 Year','6 months','3 months','Year to date')='Year to date',top(sum({1&amp;lt;NROTIT={$(v1)},DATE_VALEUR={"$(=date(Yearstart(vDateRef)))"}&amp;gt;} DERVALTIT))&lt;/P&gt;&lt;P&gt;))))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Laurent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 12:01:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-1st-2nd-value-of-a-Getfieldselections/m-p/246179#M93828</guid>
      <dc:creator />
      <dc:date>2011-08-03T12:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get 1st, 2nd value of a Getfieldselections</title>
      <link>https://community.qlik.com/t5/QlikView/Get-1st-2nd-value-of-a-Getfieldselections/m-p/246180#M93829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Laurent,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the following code to get the first values from a field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;=SubField(Concat(DISTINCT Field, ','), ',', 1)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the 1 to 2 to get the second value, and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 12:20:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-1st-2nd-value-of-a-Getfieldselections/m-p/246180#M93829</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-08-03T12:20:19Z</dc:date>
    </item>
    <item>
      <title>Get 1st, 2nd value of a Getfieldselections</title>
      <link>https://community.qlik.com/t5/QlikView/Get-1st-2nd-value-of-a-Getfieldselections/m-p/246181#M93830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Miguel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exactly wath I want, and without variable...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wasn't aware that Concat() use also the selected values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Laurent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 13:48:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-1st-2nd-value-of-a-Getfieldselections/m-p/246181#M93830</guid>
      <dc:creator />
      <dc:date>2011-08-03T13:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Get 1st, 2nd value of a Getfieldselections</title>
      <link>https://community.qlik.com/t5/QlikView/Get-1st-2nd-value-of-a-Getfieldselections/m-p/246182#M93831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad to help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But concat doesn't returns selected values. It rather concatenates all possible values from a given field or expression. That means that, when you don't have anything selected in field "CustomerID" then all CustomerID values are possible, and hence this function will return all of them, while GetFieldSelections will not return anything. If you select only one value, the function still returns the possible values, that are, in this case, only one value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 14:00:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-1st-2nd-value-of-a-Getfieldselections/m-p/246182#M93831</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-08-03T14:00:33Z</dc:date>
    </item>
    <item>
      <title>Get 1st, 2nd value of a Getfieldselections</title>
      <link>https://community.qlik.com/t5/QlikView/Get-1st-2nd-value-of-a-Getfieldselections/m-p/246183#M93832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that precision!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2011 14:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Get-1st-2nd-value-of-a-Getfieldselections/m-p/246183#M93832</guid>
      <dc:creator />
      <dc:date>2011-08-03T14:29:33Z</dc:date>
    </item>
  </channel>
</rss>

