<?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 Need to get Index variable (quantity) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-to-get-Index-variable-quantity/m-p/268532#M1188133</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mika,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't find the right place were to put the lines mentioned above, but I think I can help you anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;Mika Rinne-Kanto schrieb:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;--&amp;gt; 1.) It tends to give me error message, that it doesn't recognise Var (&lt;EM&gt;Field not found - &amp;lt;Var&amp;gt;&lt;/EM&gt;), when I but the lines inside the load-statement, where&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I load data from some of the "&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;LaskutusSiirtoFakta.csv"-files&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.) Or the script don't give me any error messages and the new variables don't show up, when i put the script lines to the end of the script.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To point you into the right direction, lets have a look to the two script lines of your post:&lt;/P&gt;&lt;P&gt;In the first script line "&lt;EM&gt;if&lt;/EM&gt; . . . &lt;EM&gt;as Var," &lt;/EM&gt;&lt;SPAN style="text-decoration: underline;"&gt;this Var is quite another Var &lt;/SPAN&gt;than in the following line "&lt;EM&gt;if&lt;/EM&gt;. . .&amp;nbsp; &lt;EM&gt;(1+Var)*peek(Index) . .&amp;nbsp; .&lt;/EM&gt;". As you can see in the original excel-file exists a column called Var. In the second line QV refers to that excel column, NOT to your Var in the line above. And because you do not have a (excel-)column called Var in your source-file you get the errror message "Field not found &amp;lt;Var&amp;gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need the expression Var from the first line within the second line replace the Var in the second line with the whole calculation similar to this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;. . .&amp;nbsp; (1+Var)*peek(Index) . . . -- &amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; . . . (1+&lt;/EM&gt;&lt;EM&gt;([Laskutus kpl] - peek([Laskutus kpl]))/peek([Laskutus kpl])&lt;/EM&gt;&lt;EM&gt;) * peek(Index) . . . &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;HtH&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Roland&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 13 Aug 2011 16:35:58 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-08-13T16:35:58Z</dc:date>
    <item>
      <title>Need to get Index variable (quantity)</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-get-Index-variable-quantity/m-p/268531#M1188132</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;I'm having problem when trying to make a Index variable to my QlikView data.&lt;/P&gt;&lt;P&gt;I found this recent post by &lt;STRONG&gt;&lt;EM&gt;AngelaEcheverri56/ Stefan Stoichev &lt;/EM&gt;&lt;/STRONG&gt;really helpful - many thanks for that!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/message/121531"&gt;http://community.qlik.com/message/121531&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But unfortunately I couldn't implement it succesfully to my QlikView script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See my attached current QV-script. In script the main data is loaded from separate files for each year 2009, 2010 and 2011.&lt;/P&gt;&lt;P&gt;Problem seems to be, that when using above mentioned post's script lines (variables changed as my own's):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(Tuote = peek(Tuote), ([Laskutus kpl] - peek([Laskutus kpl]))/peek([Laskutus kpl])) as Var,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(Tuote = peek(Tuote), (1+Var)*peek(Index),100) as Index&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Here 'Tuote' means in finnish same as Product, and 'Laskutus kpl' quantity in english - so I want to make here an Index from quantity/ volume, not price&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; 1.) It tends to give me error message, that it doesn't recognise Var (&lt;EM&gt;Field not found - &amp;lt;Var&amp;gt;&lt;/EM&gt;), when I but the lines inside the load-statement, where&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I load data from some of the "&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;LaskutusSiirtoFakta.csv"-files&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.) Or the script don't give me any error messages and the new variables don't show up, when i put the script lines to the end of the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also attached little example of my excel-data. There are only first and last rows of the data and some columns has been erased.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where do I need to put these script lines and how do I have to change them so, that the index 100 = first month of the data (january 2009)?&lt;/P&gt;&lt;P&gt;And the index=100 has to be for every product. And do I need to concatenate my tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would really appreciate help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Aug 2011 12:35:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-get-Index-variable-quantity/m-p/268531#M1188132</guid>
      <dc:creator />
      <dc:date>2011-08-12T12:35:26Z</dc:date>
    </item>
    <item>
      <title>Need to get Index variable (quantity)</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-get-Index-variable-quantity/m-p/268532#M1188133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mika,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't find the right place were to put the lines mentioned above, but I think I can help you anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;Mika Rinne-Kanto schrieb:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;--&amp;gt; 1.) It tends to give me error message, that it doesn't recognise Var (&lt;EM&gt;Field not found - &amp;lt;Var&amp;gt;&lt;/EM&gt;), when I but the lines inside the load-statement, where&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I load data from some of the "&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;LaskutusSiirtoFakta.csv"-files&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.) Or the script don't give me any error messages and the new variables don't show up, when i put the script lines to the end of the script.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To point you into the right direction, lets have a look to the two script lines of your post:&lt;/P&gt;&lt;P&gt;In the first script line "&lt;EM&gt;if&lt;/EM&gt; . . . &lt;EM&gt;as Var," &lt;/EM&gt;&lt;SPAN style="text-decoration: underline;"&gt;this Var is quite another Var &lt;/SPAN&gt;than in the following line "&lt;EM&gt;if&lt;/EM&gt;. . .&amp;nbsp; &lt;EM&gt;(1+Var)*peek(Index) . .&amp;nbsp; .&lt;/EM&gt;". As you can see in the original excel-file exists a column called Var. In the second line QV refers to that excel column, NOT to your Var in the line above. And because you do not have a (excel-)column called Var in your source-file you get the errror message "Field not found &amp;lt;Var&amp;gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need the expression Var from the first line within the second line replace the Var in the second line with the whole calculation similar to this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;. . .&amp;nbsp; (1+Var)*peek(Index) . . . -- &amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; . . . (1+&lt;/EM&gt;&lt;EM&gt;([Laskutus kpl] - peek([Laskutus kpl]))/peek([Laskutus kpl])&lt;/EM&gt;&lt;EM&gt;) * peek(Index) . . . &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;HtH&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Roland&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Aug 2011 16:35:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-get-Index-variable-quantity/m-p/268532#M1188133</guid>
      <dc:creator />
      <dc:date>2011-08-13T16:35:58Z</dc:date>
    </item>
    <item>
      <title>Need to get Index variable (quantity)</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-get-Index-variable-quantity/m-p/268533#M1188134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Roland,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And first sorry for the late reply. Thanks for the helpful answer. Now I managed to get that Index variable show up. I only got it work when I put that line right after the &lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;LaskutusSiirtoFakta.csv -load statement (after the last variable [Laskutus kpl]). But no matter after which of the three &lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;LaskutusSiirtoFakta.csv -load statements I put it, it puts year 2011 as Index-base, so no year 2009 (?). And it only shows up Index value 100 and there's no movement in that variable in diffenent months. So I would like to get index value 100 to january 2009 for every product.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt; font-family: 'Courier New';"&gt;With best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 9pt; font-family: 'Courier New';"&gt;Mika&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 11:53:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-get-Index-variable-quantity/m-p/268533#M1188134</guid>
      <dc:creator />
      <dc:date>2011-08-18T11:53:59Z</dc:date>
    </item>
    <item>
      <title>Need to get Index variable (quantity)</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-get-Index-variable-quantity/m-p/268534#M1188135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mika,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no problem with your late reply. Most of us have to do other things time by time . . .&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Don't know if you fixed it all meanwhile. If not, please post an example app to show what are you struggling with. As we say (german): A picture tells more than thousand words.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2011 12:18:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-get-Index-variable-quantity/m-p/268534#M1188135</guid>
      <dc:creator />
      <dc:date>2011-08-22T12:18:06Z</dc:date>
    </item>
  </channel>
</rss>

