<?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 macro to replace always one selected option in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211672#M65882</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;Attached is the simple example see the document properties _ macros maybe this is the way you are looking for&lt;/P&gt;&lt;P&gt;Talha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Oct 2009 23:09:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-10-08T23:09:26Z</dc:date>
    <item>
      <title>macro to replace always one selected option</title>
      <link>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211671#M65881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to create a macro that basically replace the option "always one selected" for a multi box or list box. Either when the document is opened or when a sheet is opened, I want a selection or the first selection of a field in a multi box or list box to be selected. This field should not allow the selection to be cleared but should allow the user to make another selection from the field.&lt;/P&gt;&lt;P&gt;For example, if I have an employee name as a field in a multi-box, then when I open the document or switch to that sheet, the macro should force a name to be selected. I should not be able to clear the selection because at least 1 name should be selected. HOwever, he user should be able to select another name from the list.&lt;/P&gt;&lt;P&gt;I have never created a macro so I am not even sure where to begin. Any help would be greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2009 21:27:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211671#M65881</guid>
      <dc:creator />
      <dc:date>2009-10-08T21:27:11Z</dc:date>
    </item>
    <item>
      <title>macro to replace always one selected option</title>
      <link>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211672#M65882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;Attached is the simple example see the document properties _ macros maybe this is the way you are looking for&lt;/P&gt;&lt;P&gt;Talha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2009 23:09:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211672#M65882</guid>
      <dc:creator />
      <dc:date>2009-10-08T23:09:26Z</dc:date>
    </item>
    <item>
      <title>macro to replace always one selected option</title>
      <link>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211673#M65883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just curious - why not to use "always one" option?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2009 08:51:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211673#M65883</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-09T08:51:12Z</dc:date>
    </item>
    <item>
      <title>macro to replace always one selected option</title>
      <link>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211674#M65884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After the document has been reloaded on the server nothing is selected, so "always one" is not checked.&lt;/P&gt;&lt;P&gt;Marko&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2009 18:06:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211674#M65884</guid>
      <dc:creator />
      <dc:date>2009-10-09T18:06:34Z</dc:date>
    </item>
    <item>
      <title>macro to replace always one selected option</title>
      <link>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211675#M65885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marko,&lt;/P&gt;&lt;P&gt;I have seen this "always one selected value" setting removed after reload before. The reason was because the default clear state was set before the "always one selected value" setting was applied. This may be the case in your application too. If it is you will need to apply the setting and set the default clear state again.&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Footsie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2009 18:25:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211675#M65885</guid>
      <dc:creator />
      <dc:date>2009-10-09T18:25:47Z</dc:date>
    </item>
    <item>
      <title>macro to replace always one selected option</title>
      <link>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211676#M65886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see the issue with this loading as well. We also have other issues pertaining to the always one selected as well.&lt;/P&gt;&lt;P&gt;I have been playing around with the macro information provided in the APIquide.QVW but since I am not at all familiar with this stuff, I am struggling. I was playing with things I saw in there such as SearchToggle and SetInputFieldValue but no luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2009 22:52:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211676#M65886</guid>
      <dc:creator />
      <dc:date>2009-10-09T22:52:27Z</dc:date>
    </item>
    <item>
      <title>macro to replace always one selected option</title>
      <link>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211677#M65887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see...&lt;BR /&gt;In this case I use a macro that selects a default value and sets this "always one" option. Stilla mcro, but a very simple one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Oct 2009 04:19:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211677#M65887</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-11T04:19:22Z</dc:date>
    </item>
    <item>
      <title>macro to replace always one selected option</title>
      <link>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211678#M65888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is the macro that I have been trying to create but need some assistance. I was able to figure out that the following macro would select all, a group,or one but only if the specific one you use is in the list which will not always be the case in scenario. I also have not been able to figure out the "always one selected" part of the macro either.&lt;/P&gt;&lt;P&gt;Any assistance with this is much appreciated!&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;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;function&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("ResidentName").ToggleSelect("A*")&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;Select()&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 19:08:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211678#M65888</guid>
      <dc:creator />
      <dc:date>2009-10-12T19:08:49Z</dc:date>
    </item>
    <item>
      <title>macro to replace always one selected option</title>
      <link>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211679#M65889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example for "always one selected" part of the question. You have to make a selection first for this macro to set this property.&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Sub SetOnlyOne&lt;BR /&gt; set wk=ActiveDocument.GetField("WeekOf")&lt;BR /&gt; wSel=wk.GetSelectedValues.Count&lt;BR /&gt; if wSel=1 then&lt;BR /&gt; set prop = wk.GetProperties&lt;BR /&gt; prop.OneAndOnlyOne = true&lt;BR /&gt; wk.SetProperties prop&lt;BR /&gt; end if&lt;BR /&gt;End Sub&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2009 06:58:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211679#M65889</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-13T06:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: macro to replace always one selected option</title>
      <link>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211680#M65890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where do you call this macro from?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on the same topic, but need to publish my QV file on a QV server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was considering to trigger this from the PostReload trigger, but I understood the macro will not run as the reload is performed on the server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, OnOpen trigger, but the method 'SetProperties' does not seem to be applied.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;set prop = wk.GetProperties&lt;/P&gt;&lt;P&gt;prop.OneAndOnlyOne = true&lt;/P&gt;&lt;P&gt;msgbox prop.OneAndOnlyOne&lt;/P&gt;&lt;P&gt;wk.SetProperties prop&lt;/P&gt;&lt;P&gt;msgbox prop.OneAndOnlyOne&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;will give me 2 'False' result.&lt;/P&gt;&lt;P&gt;Have you experience the same?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the same behavior by placing a button which calls the macro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 07:49:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211680#M65890</guid>
      <dc:creator />
      <dc:date>2012-02-10T07:49:14Z</dc:date>
    </item>
    <item>
      <title>macro to replace always one selected option</title>
      <link>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211681#M65891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nicolas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See another example. Notice thta you must select a value before setting "always one" property.&amp;nbsp; I mentiioned it in my old post, although without example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SetOnlyOne&lt;BR /&gt; ' first, select one value (you have to make sure it always exist after reload&lt;BR /&gt; ' it may look more complex in real app&lt;BR /&gt; set a=ActiveDocument.GetField("A")&lt;BR /&gt; A.Select "1"&lt;BR /&gt; ' set "always one selected"&lt;BR /&gt; set a=ActiveDocument.GetField("A")&lt;BR /&gt; aSel=a.GetSelectedValues.Count&lt;BR /&gt; if aSel=1 then&lt;BR /&gt;&amp;nbsp; set prop = a.GetProperties&lt;BR /&gt;&amp;nbsp; prop.OneAndOnlyOne = true&lt;BR /&gt;&amp;nbsp; a.SetProperties prop&lt;BR /&gt; end if&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The macro can be triggered by "post reload" or "on open"&lt;/P&gt;&lt;P&gt;(I tested it, it worked)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Feb 2012 13:41:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/macro-to-replace-always-one-selected-option/m-p/211681#M65891</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-10T13:41:17Z</dc:date>
    </item>
  </channel>
</rss>

