<?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: Macro with array variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865639#M1009763</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What kind of Array did you have in mind? A VBscript Array? Or do you refer to a Range in QlikView ... ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 May 2015 21:11:31 GMT</pubDate>
    <dc:creator>petter</dc:creator>
    <dc:date>2015-05-14T21:11:31Z</dc:date>
    <item>
      <title>Macro with array variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865638#M1009762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing a macro to compare multiple values in a table (see below) , I want to be able to run a macro which compares every even and odd values and give me a result. For example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMPARE 12 and 5 (which is greater)&lt;/P&gt;&lt;P&gt;and then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMPARE 26 and 45 (which is greater)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and do that 'n' number of times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 1&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;26&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what i wrote so far&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sub Risk&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;i = ActiveDocument.Variables("vi").GetContent.string&amp;nbsp;&amp;nbsp;&amp;nbsp; /P.S (vi = 0) &lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dim A1(100)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;i = i + 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set mytext3 = ActiveDocument.GetSheetObject("CH27").GetCell(i,3)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ActiveDocument.Variables("A1").SetContent mytext3.text, true &lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Loop while i &amp;lt;= 3&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;End Sub&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to store every result in an array. Please advise ? (Hope my question makes sense) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 20:58:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865638#M1009762</guid>
      <dc:creator />
      <dc:date>2015-05-14T20:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Macro with array variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865639#M1009763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What kind of Array did you have in mind? A VBscript Array? Or do you refer to a Range in QlikView ... ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 21:11:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865639#M1009763</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-14T21:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macro with array variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865640#M1009764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking for an array which i can access in Qlikview to compare the values and show a trend chart. Is there a way to do it directly without writing a VB script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for a response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;NIk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 21:14:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865640#M1009764</guid>
      <dc:creator />
      <dc:date>2015-05-14T21:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Macro with array variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865641#M1009765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes - the thing you are trying to achieve in your VBScript Macro is very straight forward to do directly in a chart...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an example for you that you can see attached:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2015-05-14 #6.PNG" class="jive-image image-1" src="/legacyfs/online/86633_2015-05-14 #6.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 21:26:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865641#M1009765</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-14T21:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Macro with array variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865642#M1009766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is certainly more straight forward. Just so i understand clearly, Mod(RowNo(), 2) is a modulo function will set row no to 1 and 2 respectively and Above [N'] is just taking the entire N' column and comparing every 2 rows. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I apologize if the question is a silly one and the answer maybe obvious.&amp;nbsp; I am not familiar with QlikView syntax at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Nik &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 21:35:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865642#M1009766</guid>
      <dc:creator />
      <dc:date>2015-05-14T21:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Macro with array variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865643#M1009767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't apologize - your questions are not silly at all. I made the answer and solution in a hurry and didn't explain much. Even though it looks "easy" it takes some explaining especially if Above() is a new thing for you...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above( [N'] )&amp;nbsp;&amp;nbsp; alone just picks the value above the current row for the column named N' which has to be enclosed in the square brackets to be interpreted correctly by QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Mod() function returns 0 or 1 in fact so I test for a 0 because that will be true on every even row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above() can take more parameters if you need to pick out more than one value from a column.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 21:41:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865643#M1009767</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-14T21:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Macro with array variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865644#M1009768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for explaining. I have an access database connected to qlikview , and depending on the selection the user makes from different columns , the chart box gets populated after which i compare the values and insert a trend arrow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you have will fulfil what i am trying to accomplish give that the Row No() will only give me the rows of that chart box. I will give it a go and get back to you if i have more questions;&amp;nbsp; if you dont mind ofcourse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 21:51:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865644#M1009768</guid>
      <dc:creator />
      <dc:date>2015-05-14T21:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macro with array variable</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865645#M1009769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please do - and if you got your answer mark the question as answered. You can post a new question for additional help &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 21:54:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-with-array-variable/m-p/865645#M1009769</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-14T21:54:11Z</dc:date>
    </item>
  </channel>
</rss>

