<?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 Index Function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734660#M1050424</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;could you please explain how index function working&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;left( Date, index( Date,'-') -1 )&lt;/SPAN&gt; where &lt;SPAN class="Italic"&gt;Date&lt;/SPAN&gt; = 1997-07-14 returns &lt;SPAN class="Italic"&gt;1997&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;mid( Date, index( Date, '-', 2 ) -2, 2 )&lt;/SPAN&gt; where &lt;SPAN class="Italic"&gt;Date&lt;/SPAN&gt; = 1997-07-14 returns &lt;SPAN class="Italic"&gt;07&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Many Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Oct 2014 14:27:48 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-30T14:27:48Z</dc:date>
    <item>
      <title>Index Function</title>
      <link>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734660#M1050424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;could you please explain how index function working&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;left( Date, index( Date,'-') -1 )&lt;/SPAN&gt; where &lt;SPAN class="Italic"&gt;Date&lt;/SPAN&gt; = 1997-07-14 returns &lt;SPAN class="Italic"&gt;1997&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;mid( Date, index( Date, '-', 2 ) -2, 2 )&lt;/SPAN&gt; where &lt;SPAN class="Italic"&gt;Date&lt;/SPAN&gt; = 1997-07-14 returns &lt;SPAN class="Italic"&gt;07&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Many Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2014 14:27:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734660#M1050424</guid>
      <dc:creator />
      <dc:date>2014-10-30T14:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Index Function</title>
      <link>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734661#M1050425</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;SPAN class="Code" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;left( Date, index( Date,'-') -1 )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Here "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;index( Date,'-') -1" gives 5-1 which is 4 .&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;so &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;left( Date,4) gives 1997&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN class="Code" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;mid( Date, index( Date, '-', 2 ) -2, 2 )&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Here&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;index( Date, '-', 2 ) gives the index of second occurence of '-' which is 8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;so Mid(Date,8-2,2) = Mid(Date,6,2) = 07&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2014 14:31:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734661#M1050425</guid>
      <dc:creator />
      <dc:date>2014-10-30T14:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Index Function</title>
      <link>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734662#M1050426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your example, the index function is finding the numerical character position of the&amp;nbsp; first&amp;nbsp; ( &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; index( Date,'-')&amp;nbsp; )&lt;/SPAN&gt;or second ( &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;index( Date, '-', 2 ) )&amp;nbsp; &lt;/SPAN&gt;instance of the hyphen ( - )&amp;nbsp; character in the string that is Date.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then there is a&amp;nbsp; subtraction of that number.&amp;nbsp; In the first case its 5 - 1 = 4.&amp;nbsp; 2nd case its 8-6 = 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That number is being fed into the left() and Mid() functions to take a piece of the date string. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left( Date , 4) -&amp;gt; first 4 characters of Date = 1997&lt;/P&gt;&lt;P&gt;mid( Date, 6, 2) -&amp;gt; starting at position 6, take next two characters = 07&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2014 14:33:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734662#M1050426</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-10-30T14:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Index Function</title>
      <link>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734663#M1050427</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;&lt;SPAN class="Code"&gt;left( Date, index( Date,'-') -1 )&lt;/SPAN&gt; where &lt;SPAN class="Italic"&gt;Date&lt;/SPAN&gt; = 1997-07-14 returns &lt;SPAN class="Italic"&gt;1997&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;index(date,'-') it will give by default first position of '-' that is 5 then left(date,5-1) is left(date,4) it will give finally 1997&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;mid( Date, index( Date, '-', 2 ) -2, 2 )&lt;/SPAN&gt; where &lt;SPAN class="Italic"&gt;Date&lt;/SPAN&gt; = 1997-07-14 returns &lt;SPAN class="Italic"&gt;07&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;index(date,'-',2) it will give second '-' position that is 8 then 8-2 is 6&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;mid(date,6,2) it will give 07&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2014 14:35:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734663#M1050427</guid>
      <dc:creator />
      <dc:date>2014-10-30T14:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Index Function</title>
      <link>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734664#M1050428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&amp;nbsp; Shruthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was not under standing -1 use in firstexp, -2 use second exp .. thanks for help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2014 14:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734664#M1050428</guid>
      <dc:creator />
      <dc:date>2014-10-30T14:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Index Function</title>
      <link>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734665#M1050429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Index is a string function &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;left( Date, index( Date,'-') -1 )&lt;/SPAN&gt; where &lt;SPAN class="Italic"&gt;Date&lt;/SPAN&gt; = 1997-07-14 returns &lt;SPAN class="Italic"&gt;1997&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;In this line index( Date,'-') finds the location of the ('-') symbol means here is 5 then 5-1=4 so from left 4 character picks that is 1997.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;mid( Date, index( Date, '-', 2 ) -2, 2 )&lt;/SPAN&gt; where &lt;SPAN class="Italic"&gt;Date&lt;/SPAN&gt; = 1997-07-14 returns &lt;SPAN class="Italic"&gt;07&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;In this index( Date, '-', 2 ) finds the second occurrence of the ('-') symbol that is * then 8-2 = 6 from 6 picks 2 charater by mid function that is 07&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;Anand&lt;BR /&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2014 14:36:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Index-Function/m-p/734665#M1050429</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-10-30T14:36:32Z</dc:date>
    </item>
  </channel>
</rss>

