<?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: Taking the last four characters in a string in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Taking-the-last-four-characters-in-a-string/m-p/616356#M1095681</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;You can use right() function in load script to get the four digits and num#() function to convert the string into number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num#(right(Yearspan, 4),'0') as Year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read the QV help about string functions. There are many useful things.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Apr 2014 14:46:57 GMT</pubDate>
    <dc:creator>whiteline</dc:creator>
    <dc:date>2014-04-24T14:46:57Z</dc:date>
    <item>
      <title>Taking the last four characters in a string</title>
      <link>https://community.qlik.com/t5/QlikView/Taking-the-last-four-characters-in-a-string/m-p/616353#M1095678</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 have an excel sheet where one of the fields is 'Yearspan'. Within this 'Yearspan' field, there are some cells which include data in the format: 'XXXX-XXXX' and others which contain the format 'XXXX', where 'XXXX' is a year, i.e. '2001-2002', or '2002'. An example of this would be...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'Yearspan&lt;/P&gt;&lt;P&gt;2001-2002&lt;/P&gt;&lt;P&gt;2009&lt;/P&gt;&lt;P&gt;2010-2011&lt;/P&gt;&lt;P&gt;2013&lt;/P&gt;&lt;P&gt;2014&lt;/P&gt;&lt;P&gt;2005-2006&lt;/P&gt;&lt;P&gt;2003-2004'&lt;/P&gt;&lt;P&gt;and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a column that only takes the second year if the format is 'XXXX-XXXX', so if '2001-2002', only take '2002'. If the field is 'XXXX', just to take that year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The end result needs to be a column which only includes dates in the 'XXXX' format, i.e. just one year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible? Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 14:37:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Taking-the-last-four-characters-in-a-string/m-p/616353#M1095678</guid>
      <dc:creator />
      <dc:date>2014-04-24T14:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Taking the last four characters in a string</title>
      <link>https://community.qlik.com/t5/QlikView/Taking-the-last-four-characters-in-a-string/m-p/616354#M1095679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just write this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Right(Yearspan,4) as NewFiled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Right(Yearspan,4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will give you below output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="148"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="148"&gt;2002&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;2009&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;2013&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;2014&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;2006&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;2004&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 14:44:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Taking-the-last-four-characters-in-a-string/m-p/616354#M1095679</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-04-24T14:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Taking the last four characters in a string</title>
      <link>https://community.qlik.com/t5/QlikView/Taking-the-last-four-characters-in-a-string/m-p/616355#M1095680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi O G,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use right(Yearspan,4).&lt;/P&gt;&lt;P&gt;it Returns you the last 4 parts of your stirng.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 14:44:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Taking-the-last-four-characters-in-a-string/m-p/616355#M1095680</guid>
      <dc:creator>lukaspuschner</dc:creator>
      <dc:date>2014-04-24T14:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Taking the last four characters in a string</title>
      <link>https://community.qlik.com/t5/QlikView/Taking-the-last-four-characters-in-a-string/m-p/616356#M1095681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;You can use right() function in load script to get the four digits and num#() function to convert the string into number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num#(right(Yearspan, 4),'0') as Year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read the QV help about string functions. There are many useful things.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 14:46:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Taking-the-last-four-characters-in-a-string/m-p/616356#M1095681</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2014-04-24T14:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Taking the last four characters in a string</title>
      <link>https://community.qlik.com/t5/QlikView/Taking-the-last-four-characters-in-a-string/m-p/616357#M1095682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SubField(Yearspan,'-',-1) as LastYear&lt;/SPAN&gt; will do the trick.&lt;/P&gt;&lt;P&gt;You can use negative numbers in the SubField function to pick the substrings backwards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 14:56:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Taking-the-last-four-characters-in-a-string/m-p/616357#M1095682</guid>
      <dc:creator>msvanfeldt</dc:creator>
      <dc:date>2014-04-24T14:56:25Z</dc:date>
    </item>
  </channel>
</rss>

