<?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: values from field to array by macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/values-from-field-to-array-by-macro/m-p/441859#M697690</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solve by using macro and variables&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jan 2013 13:09:01 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-01-24T13:09:01Z</dc:date>
    <item>
      <title>values from field to array by macro</title>
      <link>https://community.qlik.com/t5/QlikView/values-from-field-to-array-by-macro/m-p/441855#M697686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have simple table with fields: country, sale, cost&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i need to fill arrow (My_array with data from field sale:&amp;nbsp; My_array = ActiveDocument.GetField ("Sale")&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then i want calculate new arrow data in macro, example:&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i=0 to My_arraycount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My_array_new = My_array + 10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and finaly add new field to my table which contante My_array_new&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it possible in QV such opertiotion?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 08:59:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/values-from-field-to-array-by-macro/m-p/441855#M697686</guid>
      <dc:creator />
      <dc:date>2013-01-22T08:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: values from field to array by macro</title>
      <link>https://community.qlik.com/t5/QlikView/values-from-field-to-array-by-macro/m-p/441856#M697687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why You want to do it by macro?&lt;/P&gt;&lt;P&gt;Why don't You just use &lt;STRONG&gt;above()&lt;/STRONG&gt; function?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 12:43:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/values-from-field-to-array-by-macro/m-p/441856#M697687</guid>
      <dc:creator />
      <dc:date>2013-01-22T12:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: values from field to array by macro</title>
      <link>https://community.qlik.com/t5/QlikView/values-from-field-to-array-by-macro/m-p/441857#M697688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I need try to do it by macros for another task.that is why this example is simple. in my real task i try to solve this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. rank customers by sale with some expression&amp;nbsp; main think: the most bigger customers those get 50% of total sale - rank "A", from 50%-80% - rank "B", from 80%-95% - rank "C", after 95% - rank "D". I use order by Sale desc field to get this.&lt;/P&gt;&lt;P&gt;2. rank customers by profit. I mean (sale / cost -1)&amp;nbsp; main think: the most bigger customers by (sale / cost -1) expression get 30% sale - rank "3", from 30%-70% - rank "2", after 70% - rank "1". I use order by (sale / cost -1) desc field to get this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i need join 2 rank in 1. it will be like:&amp;nbsp; A3, A2, A1, B3, B2 .... and s.o.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my problem is sorting: if i change sorting field, i lose my rank. that is why i thinking about macro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 12:51:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/values-from-field-to-array-by-macro/m-p/441857#M697688</guid>
      <dc:creator />
      <dc:date>2013-01-22T12:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: values from field to array by macro</title>
      <link>https://community.qlik.com/t5/QlikView/values-from-field-to-array-by-macro/m-p/441858#M697689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i found how load data from field to array&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub ABC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set val=ActiveDocument.Fields("Sale").GetSelectedValues&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i=0 to val.Count-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val.Item(i).Number = val.Item(i).Number+10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;msgbox(val.Item(0).Number)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now how add field with this new data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 13:32:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/values-from-field-to-array-by-macro/m-p/441858#M697689</guid>
      <dc:creator />
      <dc:date>2013-01-22T13:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: values from field to array by macro</title>
      <link>https://community.qlik.com/t5/QlikView/values-from-field-to-array-by-macro/m-p/441859#M697690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solve by using macro and variables&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 13:09:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/values-from-field-to-array-by-macro/m-p/441859#M697690</guid>
      <dc:creator />
      <dc:date>2013-01-24T13:09:01Z</dc:date>
    </item>
  </channel>
</rss>

