<?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 value with trailing numbers in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/value-with-trailing-numbers/m-p/291113#M108058</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently Im having issues with this piece of code. The first and second lines on the if statement are outputting correctly ( '40050101' changing to '2012' and '40020201' to '2014'). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the last 4 are not. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take the numcer '400401' for example. In the field @17 there are a number of values beginning with '400401'. For instance I have '40040100', '40040101', '40040102' and '40040103' - I think this is why it doesnt like the value '400401'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've used the trim and rtrim functions to help but it still doesnt seem to work. Would anyone know how to overcome this issue? Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(trim(@17) = '40050101', '2012',&lt;/P&gt;&lt;P&gt;if(trim(@17) = '40020201', '2014',&lt;/P&gt;&lt;P&gt;if(trim(@17) = '400401', '2011',&lt;/P&gt;&lt;P&gt;if(trim(@17) = '4005', '2009',&lt;/P&gt;&lt;P&gt;if(trim(@17) = '4006', '2040',&lt;/P&gt;&lt;P&gt;if(trim(@17) = '40010100', '2001')))))) as bdg_link,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Dec 2011 16:00:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-12-09T16:00:59Z</dc:date>
    <item>
      <title>value with trailing numbers</title>
      <link>https://community.qlik.com/t5/QlikView/value-with-trailing-numbers/m-p/291113#M108058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently Im having issues with this piece of code. The first and second lines on the if statement are outputting correctly ( '40050101' changing to '2012' and '40020201' to '2014'). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the last 4 are not. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take the numcer '400401' for example. In the field @17 there are a number of values beginning with '400401'. For instance I have '40040100', '40040101', '40040102' and '40040103' - I think this is why it doesnt like the value '400401'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've used the trim and rtrim functions to help but it still doesnt seem to work. Would anyone know how to overcome this issue? Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(trim(@17) = '40050101', '2012',&lt;/P&gt;&lt;P&gt;if(trim(@17) = '40020201', '2014',&lt;/P&gt;&lt;P&gt;if(trim(@17) = '400401', '2011',&lt;/P&gt;&lt;P&gt;if(trim(@17) = '4005', '2009',&lt;/P&gt;&lt;P&gt;if(trim(@17) = '4006', '2040',&lt;/P&gt;&lt;P&gt;if(trim(@17) = '40010100', '2001')))))) as bdg_link,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 16:00:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/value-with-trailing-numbers/m-p/291113#M108058</guid>
      <dc:creator />
      <dc:date>2011-12-09T16:00:59Z</dc:date>
    </item>
    <item>
      <title>value with trailing numbers</title>
      <link>https://community.qlik.com/t5/QlikView/value-with-trailing-numbers/m-p/291114#M108059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe try the like operator together with a wildcard:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;if( trim(@17) like '400401*', '2011'),&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or try using left() function&lt;/P&gt;&lt;P&gt;if( left(trim(@17),6) = '400401', '2011'),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The trim function removes leading and trailing spaces only, so you don't need it if there are no spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 16:16:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/value-with-trailing-numbers/m-p/291114#M108059</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-12-09T16:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: value with trailing numbers</title>
      <link>https://community.qlik.com/t5/QlikView/value-with-trailing-numbers/m-p/291115#M108060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using Left function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(left(@17,8) = '40050101', '2012',&lt;/P&gt;&lt;P&gt;if(left(@17,8) = '40020201', '2014',&lt;/P&gt;&lt;P&gt;if(left(@17,6) = '400401', '2011',&lt;/P&gt;&lt;P&gt;if(left(@17,4) = '4005', '2009',&lt;/P&gt;&lt;P&gt;if(left(@17,4) = '4006', '2040',&lt;/P&gt;&lt;P&gt;if(left(@17,8) = '40010100', '2001')))))) as bdg_link,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: And once again I type to slow haha. See Above that should work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 16:18:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/value-with-trailing-numbers/m-p/291115#M108060</guid>
      <dc:creator />
      <dc:date>2011-12-09T16:18:02Z</dc:date>
    </item>
  </channel>
</rss>

