<?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 for default Selections in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506351#M1132069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't need (and should avoid) a macro to do this.&lt;/P&gt;&lt;P&gt;An action of type "Select in field"can handle this&lt;/P&gt;&lt;P&gt;use&lt;/P&gt;&lt;P&gt;="(" &amp;amp; Concat(distinct &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;PRJ_Priority&lt;/SPAN&gt;,'|') &amp;amp; ")"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Nov 2013 01:45:08 GMT</pubDate>
    <dc:creator>Clever_Anjos</dc:creator>
    <dc:date>2013-11-13T01:45:08Z</dc:date>
    <item>
      <title>Macro for default Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506348#M1132066</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;I want to write a macro to make default selections based on the values available to users.&lt;/P&gt;&lt;P&gt;For Ex.&lt;/P&gt;&lt;P&gt;There is a field "Prj_Priority" with values 1,2,3,4,5. Different usesr have different values of "Prj_Priority" available to them based on their login, What I want to do in macro is to check for the available values of "Prj_Priority" for a user &amp;amp; then select those values by default while opening the document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, there is one twist here, normally default selections should be 2,3,4 &amp;amp;5 (if all values are available for a user), if only 1,2,3 are available for user then default selection should be 2&amp;amp;3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I need to have a macro/trigger on OnOpen of document. But not very familiar with writing macros.&lt;/P&gt;&lt;P&gt;Any suggestion will be of great help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have got the syntax to get the possible values available in the field using the following :&lt;/P&gt;&lt;P&gt;ActiveDocument.Fields("PRJ_Priority").GetPossibleValues&lt;/P&gt;&lt;P&gt;But how to match it with default selections (2,3,4 &amp;amp;5) and then select the same in PRJ_Priority ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Shyamal Pandit&#xD;
&#xD;
&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 10:32:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506348#M1132066</guid>
      <dc:creator />
      <dc:date>2013-11-11T10:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for default Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506349#M1132067</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;If you have a table that links the users to the priority field, then you can use OSUser() or QVUser() to select the user name. The links will resolve the prj_priority fields for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general, I would avoid macros, unless you will never use this model in a server environment. Actions will take care of what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 11:17:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506349#M1132067</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-11-11T11:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for default Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506350#M1132068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;I don't have a table to link priority field to user name. That's the problem. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/cry.png" /&gt;&lt;/P&gt;&lt;P&gt;Actions/Macros anything will do, as of now I am open to all options, just trying to achieve this any how.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 11:28:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506350#M1132068</guid>
      <dc:creator />
      <dc:date>2013-11-11T11:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for default Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506351#M1132069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't need (and should avoid) a macro to do this.&lt;/P&gt;&lt;P&gt;An action of type "Select in field"can handle this&lt;/P&gt;&lt;P&gt;use&lt;/P&gt;&lt;P&gt;="(" &amp;amp; Concat(distinct &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;PRJ_Priority&lt;/SPAN&gt;,'|') &amp;amp; ")"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2013 01:45:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506351#M1132069</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2013-11-13T01:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for default Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506352#M1132070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;Yes, I am trying to achieve this using "Select in Field" only.&lt;/P&gt;&lt;P&gt;Something like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=If(GetFieldSelections(Prj_Priority)=1,'',&lt;/P&gt;&lt;P&gt;If(GetFieldSelections(Prj_Priority)=2,2,&lt;/P&gt;&lt;P&gt;If(GetFieldSelections(Prj_Priority)=3,3,&lt;/P&gt;&lt;P&gt;If(GetFieldSelections(Prj_Priority)=4,4,&lt;/P&gt;&lt;P&gt;If(GetFieldSelections(Prj_Priority)=5,5,&lt;/P&gt;&lt;P&gt;)))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works perfectly fine, but the problem is, it works only for one value at a time. I have situation where user can have more than one value at a time.&amp;nbsp; I need something similar to what "in" does in SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope I made myself clear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2013 06:52:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506352#M1132070</guid>
      <dc:creator />
      <dc:date>2013-11-13T06:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for default Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506353#M1132071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it! Achieved it using Actions rather than Macro.&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;For anybody's reference :&lt;/P&gt;&lt;P&gt;I just added 2 actions:&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;1. Select In field&lt;/P&gt;&lt;P&gt;Field Name : PRJ_Priority&lt;/P&gt;&lt;P&gt;Search String : ='(' &amp;amp; Concat ( DISTINCT [PRJ_Priority], '|') &amp;amp; ')' &lt;/P&gt;&lt;P&gt; &lt;BR /&gt;2. Toggle Select&lt;/P&gt;&lt;P&gt;Field Name : PRJ_Priority&lt;/P&gt;&lt;P&gt;Search String : ='(*1*)&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;This helped me in selecting only the values I wanted to select by default.&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;Thanks everyone for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 10:38:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506353#M1132071</guid>
      <dc:creator />
      <dc:date>2013-11-18T10:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for default Selections</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506354#M1132072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #ffffee;"&gt;="(" &amp;amp; Concat(distinct &lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #ffffee;"&gt;PRJ_Priority&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #ffffee;"&gt;,'|') &amp;amp; ")" will handle multiple selections&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 11:00:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-default-Selections/m-p/506354#M1132072</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2013-11-18T11:00:52Z</dc:date>
    </item>
  </channel>
</rss>

