<?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 select default values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-select-default-values/m-p/156878#M505127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;&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&gt;I am using this macro to clear my selection values upon open and select current year as default selection value. This works for most object witht exception of any object that has a set analysis coding. It is necessary to clear all then make year selection in order for Set analysis to work properly. Can some one tell me how I can make the default selection value work for objects with set analysis?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SetDefaulFYYear&lt;BR /&gt;ActiveDocument.ClearAll(true)&lt;BR /&gt;ActiveDocument.Fields("CalType").Select"Fiscal"&lt;BR /&gt;ActiveDocument.Fields("FYYear").Select "2009"&lt;BR /&gt;ActiveDocument.Fields("CalYear").Select "2009"&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Tried two set analysis statements&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;1.&lt;/P&gt;&lt;P&gt;Current Year :Sum({&amp;lt;FY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year={&lt;B&gt;&lt;I&gt;$(=GetFieldSelections(FYYear))&lt;/I&gt;&lt;/B&gt;}&amp;gt;} BOOKVALUE)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P style="font-style: italic"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last Year: Sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;({$&amp;lt;FYYear={&lt;B&gt;&lt;I&gt;$(=GetFieldSelections(FYYear)-1)&lt;/I&gt;&lt;/B&gt;}&amp;gt;} BOOKVALUE)&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P style="font-style: italic"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current Year: sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;({&amp;lt;FYYear={&lt;B&gt;&lt;I&gt;$(=Only(FYYear))&lt;/I&gt;&lt;/B&gt;}&amp;gt;}PLANVALUE)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Last Year: sum({&amp;lt;FYYear={&lt;B&gt;&lt;I&gt;$(=Only(FYYear)-1)&lt;/I&gt;&lt;/B&gt;}&amp;gt;}PLANVALUE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both set analysis code gives the same results. values are displayed only after sheet has been cleared and year value selected.&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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Aug 2009 19:04:17 GMT</pubDate>
    <dc:creator>karensmith</dc:creator>
    <dc:date>2009-08-13T19:04:17Z</dc:date>
    <item>
      <title>Macro to select default values</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-select-default-values/m-p/156878#M505127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;&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&gt;I am using this macro to clear my selection values upon open and select current year as default selection value. This works for most object witht exception of any object that has a set analysis coding. It is necessary to clear all then make year selection in order for Set analysis to work properly. Can some one tell me how I can make the default selection value work for objects with set analysis?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub SetDefaulFYYear&lt;BR /&gt;ActiveDocument.ClearAll(true)&lt;BR /&gt;ActiveDocument.Fields("CalType").Select"Fiscal"&lt;BR /&gt;ActiveDocument.Fields("FYYear").Select "2009"&lt;BR /&gt;ActiveDocument.Fields("CalYear").Select "2009"&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Tried two set analysis statements&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;1.&lt;/P&gt;&lt;P&gt;Current Year :Sum({&amp;lt;FY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year={&lt;B&gt;&lt;I&gt;$(=GetFieldSelections(FYYear))&lt;/I&gt;&lt;/B&gt;}&amp;gt;} BOOKVALUE)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P style="font-style: italic"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last Year: Sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;({$&amp;lt;FYYear={&lt;B&gt;&lt;I&gt;$(=GetFieldSelections(FYYear)-1)&lt;/I&gt;&lt;/B&gt;}&amp;gt;} BOOKVALUE)&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P style="font-style: italic"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current Year: sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;({&amp;lt;FYYear={&lt;B&gt;&lt;I&gt;$(=Only(FYYear))&lt;/I&gt;&lt;/B&gt;}&amp;gt;}PLANVALUE)&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Last Year: sum({&amp;lt;FYYear={&lt;B&gt;&lt;I&gt;$(=Only(FYYear)-1)&lt;/I&gt;&lt;/B&gt;}&amp;gt;}PLANVALUE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both set analysis code gives the same results. values are displayed only after sheet has been cleared and year value selected.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2009 19:04:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-select-default-values/m-p/156878#M505127</guid>
      <dc:creator>karensmith</dc:creator>
      <dc:date>2009-08-13T19:04:17Z</dc:date>
    </item>
    <item>
      <title>Macro to select default values</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-select-default-values/m-p/156879#M505128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Karen,&lt;/P&gt;&lt;P&gt;I can only guess that you might have other selection fields related to dates, and those fields, when selected, distort your expected result from the Set Analysis Expression.&lt;/P&gt;&lt;P&gt;For example - if you allow user selection in fields Year, Month and Day, and someone selected a specific month, your Set Analysis expressions that only take care of the Year, will show results only for the selected Month.&lt;/P&gt;&lt;P&gt;If that's the case, you can ignore user selections in Date-related fields by specifying them in your set analysis:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;({&amp;lt;FYYear={&lt;B&gt;&lt;I&gt;$(=Only(FYYear))&lt;/I&gt;&lt;/B&gt;}, Month= , Day= &amp;gt;}PLANVALUE)&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;DIV id="refHTML"&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2009 19:55:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-select-default-values/m-p/156879#M505128</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-08-13T19:55:40Z</dc:date>
    </item>
    <item>
      <title>Macro to select default values</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-select-default-values/m-p/156880#M505130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oleg,&lt;/P&gt;&lt;P&gt;Thanks for the quick response on this question. Your recommendation worked great!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2009 20:48:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-select-default-values/m-p/156880#M505130</guid>
      <dc:creator>karensmith</dc:creator>
      <dc:date>2009-08-13T20:48:19Z</dc:date>
    </item>
  </channel>
</rss>

