<?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: subfield with negative values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434824#M162096</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A negative index (third parameter to subfield() function) should count and extract your field portion from the end of the string:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;subfield('Begin\End','\',1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will return 'Begin'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;subfield('Begin\End','\',-1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will return 'End'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Apr 2013 09:42:22 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-04-09T09:42:22Z</dc:date>
    <item>
      <title>subfield with negative values</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434817#M162089</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 am trying to understand the subfield(fieldname,'\', -1)&amp;nbsp; what does the -1 values mean when i am uisng&amp;nbsp; script..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i am having year as a field name, when i use the above function in script it sorts the order by desc to ascending..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am confused what it will return the value when used in load script..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 02:22:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434817#M162089</guid>
      <dc:creator>shree909</dc:creator>
      <dc:date>2013-04-09T02:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: subfield with negative values</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434818#M162090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the value in your fieldname is for example:&lt;EM&gt; 'one;two;three' &lt;/EM&gt;and the expression is:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;subfield(fieldname, ';', -1)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Index&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Returned&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; one&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; two&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; three&lt;/P&gt;&lt;P&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; null()&lt;/P&gt;&lt;P&gt;-1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; three&lt;/P&gt;&lt;P&gt;-2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; two&lt;/P&gt;&lt;P&gt;-3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; one&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 03:11:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434818#M162090</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-09T03:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: subfield with negative values</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434819#M162091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You can refer Reference manual page no 323 .&lt;/P&gt;&lt;P&gt;There you can find sufficient one to understand .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use -1 in Subfield it returns the Last value of the string after the Delimiter '\' .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 03:59:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434819#M162091</guid>
      <dc:creator />
      <dc:date>2013-04-09T03:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: subfield with negative values</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434820#M162092</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;-1 identified to have the last value in the string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose you have a datafield like 2013\02\03&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so your above function will return 03&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you use s&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;ubfield(datafield,'\', 1) then it will return 2013&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I didn't understand your statement:&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;when i am having year as a field name, when i use the above function in script it sorts the order by desc to ascending..&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;HTH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Sushil&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 04:46:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434820#M162092</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2013-04-09T04:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: subfield with negative values</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434821#M162093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;-1 means the last string in the seguence &lt;/P&gt;&lt;P&gt;so if you have aaa,bbb,ccc,ddd&lt;/P&gt;&lt;P&gt;-1 extract ddd, -2 is ccc and so on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 06:54:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434821#M162093</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2013-04-09T06:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: subfield with negative values</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434822#M162094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as far as i remember, index should be positive&lt;/P&gt;&lt;P&gt;subfield function will return the &lt;EM&gt;index&lt;/EM&gt; position of &lt;EM&gt;fieldname&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 08:20:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434822#M162094</guid>
      <dc:creator />
      <dc:date>2013-04-09T08:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: subfield with negative values</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434823#M162095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It always mean subtext after last delimeter (or first subtext from right to left). &lt;/P&gt;&lt;P&gt;For example, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if you have Fieldname = '12\03\2012', &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;subfield(fieldname,'\', -1) &lt;/SPAN&gt;= '2012'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if you have Fieldname = '12\03', &lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;subfield(fieldname,'\', -1) &lt;/SPAN&gt;= '03'&lt;/P&gt;&lt;P&gt;What do you want to reach with using this function?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 09:09:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434823#M162095</guid>
      <dc:creator />
      <dc:date>2013-04-09T09:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: subfield with negative values</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434824#M162096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A negative index (third parameter to subfield() function) should count and extract your field portion from the end of the string:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;subfield('Begin\End','\',1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will return 'Begin'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;subfield('Begin\End','\',-1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will return 'End'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 09:42:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434824#M162096</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-04-09T09:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: subfield with negative values</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434825#M162097</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;subfield(&lt;SPAN style="font-style: italic;"&gt;text, 'delimiter' [,n] &lt;/SPAN&gt;&lt;SPAN style="font-style: normal;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;-it splits s after delimiter and takes the n'th split part&lt;/P&gt;&lt;P&gt;-if n is negative then it will result the n'th split part from reverse (absolute of n) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exemple given:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;subfield('20\07\2005','\',2)='07'&lt;/P&gt;&lt;P&gt;subfield('20\07\2005','\', 4)=''&amp;nbsp;&amp;nbsp;&amp;nbsp; (empty string)&lt;/P&gt;&lt;P&gt;subfield('20\07\2005','\', -1)='2005'&lt;/P&gt;&lt;P&gt;subfield('20\07\2005','\', -3)='20'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so &lt;/P&gt;&lt;P&gt;subfield('a;b;c;d;e;f;g;h;i;j;k;l;m' , ';' , -3)='k'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (3 rd position from reverse)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 11:34:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434825#M162097</guid>
      <dc:creator />
      <dc:date>2013-04-09T11:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: subfield with negative values</title>
      <link>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434826#M162098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the script below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subfield(F1,',', -1) as F1;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; F1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "10,20,30,40"&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you -1 in the Subfield, then you will get 40 in F1, when negative number it gets the value from right.&lt;/P&gt;&lt;P&gt;If you -2 in the Subfield, then you will get 30 in F1, when negative number it gets the value from right.&lt;/P&gt;&lt;P&gt;If you 1 in the Subfield, then you will get 10 in F1, when positive number it gets the value from left.&lt;/P&gt;&lt;P&gt;If you 2 in the Subfield, then you will get 20 in F1, when positive number it gets the value from left.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps in understanding the SubField().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 11:58:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/subfield-with-negative-values/m-p/434826#M162098</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2013-04-09T11:58:13Z</dc:date>
    </item>
  </channel>
</rss>

