<?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: Default selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Default-selection/m-p/290048#M107656</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are talking about default selection, you are talking about setting these values on opening the document or when you enter a sheet, something like that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use actions triggered by some event to achieve what I think you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, create a button with action Selection - Select in Field.&lt;/P&gt;&lt;P&gt;Then enter &lt;/P&gt;&lt;P&gt;Year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as field name, or however your Year fieldname is (but without equal sign or single quotes, just the name)&lt;/P&gt;&lt;P&gt;and as search expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;='=sum({&amp;lt;Years = {"&amp;gt;$(=max(Years)-2)"}&amp;gt;} 1)'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A click on the button should select last two years, please see attached demo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this works, you can use any appropriately triggered action e.g. under document properties -Triggers - OnOpen event, to have this done automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jan 2012 15:27:38 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-01-19T15:27:38Z</dc:date>
    <item>
      <title>Default selection</title>
      <link>https://community.qlik.com/t5/QlikView/Default-selection/m-p/290047#M107655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to select the last two years as default selection. If anybody knows the syntax I would appreciate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nima&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 14:52:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Default-selection/m-p/290047#M107655</guid>
      <dc:creator />
      <dc:date>2012-01-19T14:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Default selection</title>
      <link>https://community.qlik.com/t5/QlikView/Default-selection/m-p/290048#M107656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are talking about default selection, you are talking about setting these values on opening the document or when you enter a sheet, something like that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use actions triggered by some event to achieve what I think you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, create a button with action Selection - Select in Field.&lt;/P&gt;&lt;P&gt;Then enter &lt;/P&gt;&lt;P&gt;Year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as field name, or however your Year fieldname is (but without equal sign or single quotes, just the name)&lt;/P&gt;&lt;P&gt;and as search expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;='=sum({&amp;lt;Years = {"&amp;gt;$(=max(Years)-2)"}&amp;gt;} 1)'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A click on the button should select last two years, please see attached demo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this works, you can use any appropriately triggered action e.g. under document properties -Triggers - OnOpen event, to have this done automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 15:27:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Default-selection/m-p/290048#M107656</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-01-19T15:27:38Z</dc:date>
    </item>
    <item>
      <title>Default selection</title>
      <link>https://community.qlik.com/t5/QlikView/Default-selection/m-p/290049#M107657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot , it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 15:32:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Default-selection/m-p/290049#M107657</guid>
      <dc:creator />
      <dc:date>2012-01-19T15:32:50Z</dc:date>
    </item>
    <item>
      <title>Default selection</title>
      <link>https://community.qlik.com/t5/QlikView/Default-selection/m-p/290050#M107658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can perfectly adopt your suggestion for a default selection in my application. Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although it works, I didn't got through why it works yet. Would you mind explaining what does the "='=" stands for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 14:36:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Default-selection/m-p/290050#M107658</guid>
      <dc:creator />
      <dc:date>2012-04-11T14:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Default selection</title>
      <link>https://community.qlik.com/t5/QlikView/Default-selection/m-p/290051#M107659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thomas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need to look out for the second single quote at the very end, it's a string, like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;='AdvancedSearchExpressionString'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where the advanced search expression is&lt;/P&gt;&lt;P&gt;=sum(....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't ask me why we need to enclose an advanced search expression in single quotes with a preceding equal sign when used in a selection action. IMHO search expressions are probably the worst documented part of QV I know of.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 21:15:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Default-selection/m-p/290051#M107659</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-04-11T21:15:12Z</dc:date>
    </item>
  </channel>
</rss>

