<?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 How do I get all values of a field through API in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-do-I-get-all-values-of-a-field-through-API/m-p/215950#M69352</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It could be something like this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Sep 2010 17:01:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-09-23T17:01:35Z</dc:date>
    <item>
      <title>How do I get all values of a field through API</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-get-all-values-of-a-field-through-API/m-p/215948#M69350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings!&lt;/P&gt;&lt;P&gt;I have trouble finding the correct API for getting all values of field. There are bunch of methids returning different varietes of selected, excluded or optional values. But I can't find any method that actually returns all values of a field, no matter their current state.&lt;/P&gt;&lt;P&gt;This is what I am trying to do. My problem with this code is that GetPossibleValues only returns the currently selectable values of the field. I want to get all values.&lt;/P&gt;&lt;PRE style="font-family: consolas;"&gt;Public Overloads Sub FilterField(ByVal fieldname As String, ByVal fieldValues As ArrayList, Optional ByVal ClearPreviousSelection As Boolean = True)&lt;BR /&gt; Dim p As QlikView.Field = App.ActiveDocument.GetField(fieldname)&lt;BR /&gt; If ClearPreviousSelection Then p.Clear()&lt;BR /&gt; Dim a = p.GetPossibleValues(p.GetCardinal)&lt;BR /&gt; For i = a.Count - 1 To 0 Step -1&lt;BR /&gt; Debug.Print(i.ToString &amp;amp; " - " &amp;amp; a(i).Text)&lt;BR /&gt; If Not fieldValues.Contains(a(i).Text) Then&lt;BR /&gt; a.RemoveAt(i)&lt;BR /&gt; End If&lt;BR /&gt; Next&lt;BR /&gt; p.SelectValues(a)&lt;BR /&gt; End Sub&lt;/PRE&gt;&lt;P&gt;I could also use second call like this to get the mutually exclusive values. But the .Add method of thge object returned is a com object and don't take any parameters. So I cant merge a and b into one array.&lt;BR /&gt; Dim b = p.GetExcludedValues(p.GetCardinal)&lt;/P&gt;&lt;P&gt;So what method should I call?&lt;/P&gt;&lt;P&gt;/Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 16:20:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-get-all-values-of-a-field-through-API/m-p/215948#M69350</guid>
      <dc:creator />
      <dc:date>2010-09-23T16:20:27Z</dc:date>
    </item>
    <item>
      <title>How do I get all values of a field through API</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-get-all-values-of-a-field-through-API/m-p/215949#M69351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure there is a method to Get All Values. It seems that there should be.&lt;/P&gt;&lt;P&gt;A workaround may be to create a QlikView variable and give it the value:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Concat({1} DISTINCT FieldName, ',')&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Then in your macro:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;valList = ActiveDocument.Variable("vVar").GetContent.String&lt;BR /&gt;valAry = Split(valList, ",")&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;That should give you an array with all of the values of a field whether they are selected or not. I'm not sure how well that is going to work in your routine though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 16:31:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-get-all-values-of-a-field-through-API/m-p/215949#M69351</guid>
      <dc:creator />
      <dc:date>2010-09-23T16:31:38Z</dc:date>
    </item>
    <item>
      <title>How do I get all values of a field through API</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-get-all-values-of-a-field-through-API/m-p/215950#M69352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It could be something like this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 17:01:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-get-all-values-of-a-field-through-API/m-p/215950#M69352</guid>
      <dc:creator />
      <dc:date>2010-09-23T17:01:35Z</dc:date>
    </item>
    <item>
      <title>How do I get all values of a field through API</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-get-all-values-of-a-field-through-API/m-p/215951#M69353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I strongly advice *not* to use the fields method: they are *very* slow. If you want to get all values, the fastest (which fortunately turns out to be the easiest too) is to Evaluate an expression which concatenate all your values with a proper set analysis which does not take the selection into account.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 17:18:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-get-all-values-of-a-field-through-API/m-p/215951#M69353</guid>
      <dc:creator />
      <dc:date>2010-09-23T17:18:42Z</dc:date>
    </item>
  </channel>
</rss>

