<?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: Selecting a numeric value from a list box using a macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967322#M331477</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the pdf of a german posting to the same topic: &lt;A href="https://community.qlik.com/thread/150385"&gt;Inputbox not more then 25000 Char's&lt;/A&gt; and I think you will find here more hints: &lt;A href="/t5/forums/searchpage/tab/message?q=inputbox macro"&gt;https://community.qlik.com/search.jspa?q=inputbox+macro&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your input-listings isn't very big (&amp;lt; 1024 chars) it could be easier to try it with normal selecting-list:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(value1|value2|value3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or with a selction-action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 05 Sep 2015 10:10:13 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2015-09-05T10:10:13Z</dc:date>
    <item>
      <title>Selecting a numeric value from a list box using a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967317#M331472</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 am having problems with selecting a numeric value from a list box using a macro. I have set up a very simple qv model to illustrate the problem. In the attached example you will see that I have :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- A table box showing some simple data (First name, Last name and Age) which I typed into excel and imported into Qlikview&lt;/P&gt;&lt;P&gt;- 2 very simple macros which are called from the 2 buttons&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first macro which selects the first name 'Steven' from the FName list box works fine whereas the 2nd macro which selectes the age 29 from the Age Listbox&amp;nbsp; does not. If I change the line &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fv(0).Text = "29" to be fv(0).Text = "Unknown" - this works ok&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume this is because a text string works ok but a numeric value does not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas how I can get the select on a number (ie age 29) to work ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My macros are listed below and I have attached the qlikview model.&lt;/P&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;&lt;P&gt;Shirley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SelectFName()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set f = ActiveDocument.Fields("FName")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set fv = f.GetNoValues&amp;nbsp; 'empty array&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fv.Add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fv(0).Text = "Steven"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.SelectValues fv&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;Sub SelectAge()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set f = ActiveDocument.Fields("Age")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set fv = f.GetNoValues&amp;nbsp; 'empty array&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fv.Add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fv(0).Text = "29"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.SelectValues fv&lt;/P&gt;&lt;P&gt;'&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2015 11:49:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967317#M331472</guid>
      <dc:creator />
      <dc:date>2015-09-03T11:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a numeric value from a list box using a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967318#M331473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not just:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; ActiveDocument.Fields("Age").Select 29&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2015 19:58:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967318#M331473</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2015-09-03T19:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a numeric value from a list box using a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967319#M331474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure if you really needs macros for this. Mostly actions could do the same. See also: &lt;A href="https://community.qlik.com/qlik-blogpost/3700"&gt;Macros are Bad&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2015 21:39:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967319#M331474</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-09-03T21:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a numeric value from a list box using a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967320#M331475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Thanks for your answer. It is helpful but in my macro I actually want to select a number of values from the list box - (I just posted on here a very simple qlikview model showing 1 item I want to select).&lt;/P&gt;&lt;P&gt;The way I want it to work is that the user enters a comma separated list of values into an input box and they then click on a button that runs a macro which selects those items in the list box (see screenshot below). I have 2 listboxes and 2 input boxes (1 for age and 1 for FirstName). The Age input box uses the var vAgeList and the FirstName input box uses the var vFNameList. The FirstName button works fine and selects the required items but the age one does not (except if I put 'Unknown' into the input box). So I can only get my method to work with text data - how can I get it to work with numbers ? Please See scripts below :&lt;/P&gt;&lt;P&gt;Thanks Shirley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function getVariable(varName)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set v = ActiveDocument.Variables(varName)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; getVariable = v.GetContent.String&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SelectFName()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set oFNList = ActiveDocument.Fields("FName")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set FNListValues = oFNList.GetNoValues 'empty array&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FNList=Split(getVariable("vFNameList"), ",")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each FN in FNList&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FNListValues.Add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FNListValues(i).Text = trim(FN)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i=i+1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oFNList.SelectValues FNListValues&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SelectAge()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set oAgeList = ActiveDocument.Fields("Age")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set AgeListValues = oAgeList.GetNoValues 'empty array&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AgeList=Split(getVariable("vAgeList"), ",")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each Age in AgeList&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AgeListValues.Add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AgeListValues(i).Text = trim(Age)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i=i+1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oAgeList.SelectValues AgeListValues&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SelectValues.bmp" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/98124_SelectValues.bmp" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Sep 2015 09:54:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967320#M331475</guid>
      <dc:creator />
      <dc:date>2015-09-05T09:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a numeric value from a list box using a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967321#M331476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Marcus&lt;/P&gt;&lt;P&gt;Thanks for your answer. I know that macros should only be used where necessary - however I put a 'cut-down' version of what I wanted to do as a post to try and simplify it - I should have described the full picture. I am trying to select a number of values from the list box from a comma separated list in an input box. It works fine work with text data but not with numbers ('age' in my example). Any ideas ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls see the full description I've put in the reply to M Woolf. I've actually updated my qlikview model to demonstrate the problem but I'm not sure how to post a qlikview model in a 'reply' here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your help&lt;/P&gt;&lt;P&gt;Shirley&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Sep 2015 10:03:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967321#M331476</guid>
      <dc:creator />
      <dc:date>2015-09-05T10:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a numeric value from a list box using a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967322#M331477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the pdf of a german posting to the same topic: &lt;A href="https://community.qlik.com/thread/150385"&gt;Inputbox not more then 25000 Char's&lt;/A&gt; and I think you will find here more hints: &lt;A href="/t5/forums/searchpage/tab/message?q=inputbox macro"&gt;https://community.qlik.com/search.jspa?q=inputbox+macro&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your input-listings isn't very big (&amp;lt; 1024 chars) it could be easier to try it with normal selecting-list:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(value1|value2|value3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or with a selction-action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Sep 2015 10:10:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967322#M331477</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-09-05T10:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a numeric value from a list box using a macro</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967323#M331478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marcus&lt;/P&gt;&lt;P&gt;Much appreciated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed some of the links and eventually found this article which does exactly what I want without a macro !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.qlikfix.com/2012/08/22/search-by-copy-and-pasting-from-an-external-list/#more-3656" title="http://www.qlikfix.com/2012/08/22/search-by-copy-and-pasting-from-an-external-list/#more-3656"&gt;Search by copy and pasting from an external list - The Qlik Fix! The Qlik Fix!&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shirley&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Sep 2015 11:36:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-numeric-value-from-a-list-box-using-a-macro/m-p/967323#M331478</guid>
      <dc:creator />
      <dc:date>2015-09-05T11:36:48Z</dc:date>
    </item>
  </channel>
</rss>

