<?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: Assigning Date based on user selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156486#M890280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess you are planning to use this in set analysis right? Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=If(GetSelectedCount(CSD.dtmDate) = 0, Date(Today() - 1, 'DD-MM-YYYY'), Concat(DISTINCT Chr(39) &amp;amp; Date(CSD.dtmDate, 'DD-MM-YYYY') &amp;amp; Chr(39), ', '))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Aug 2016 10:50:28 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-08-23T10:50:28Z</dc:date>
    <item>
      <title>Assigning Date based on user selection</title>
      <link>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156485#M890279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a scenario,where user wants to show the data of previous day. However if he selects the date from then the related days data should appear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried in this manner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #575757;"&gt;if(isnull(CSD.dtmDate),Date(Today()-1,'DD-MM-YYYY'),Date(GetFieldSelections(CSD.dtmDate),'DD-MM-YYYY')) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I was succeeded up to assign the previous day value and the user selected values to &lt;STRONG&gt;Date&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I am unable to assign the same to &lt;STRONG&gt;CSD.dtmDate.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help me to succeed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnx a lot.&lt;/P&gt;&lt;P&gt;Sudhir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156485#M890279</guid>
      <dc:creator>sudhir0538</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Date based on user selection</title>
      <link>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156486#M890280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess you are planning to use this in set analysis right? Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=If(GetSelectedCount(CSD.dtmDate) = 0, Date(Today() - 1, 'DD-MM-YYYY'), Concat(DISTINCT Chr(39) &amp;amp; Date(CSD.dtmDate, 'DD-MM-YYYY') &amp;amp; Chr(39), ', '))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 10:50:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156486#M890280</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-08-23T10:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Date based on user selection</title>
      <link>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156487#M890281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is the layout of my document upon opening.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/135289_1.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;But My requirement is like this&lt;/P&gt;&lt;P&gt;(Assume today is 22-08-2016, then the previous day 21-08-2016 data should be populated automatically upon opening of the document,However,user will have the provision to choose the date according to his will )&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/135294_1.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Sunny Yours idea is working but it's not making the date field to be auto select the previous day date. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 12:20:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156487#M890281</guid>
      <dc:creator>sudhir0538</dc:creator>
      <dc:date>2016-08-23T12:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Date based on user selection</title>
      <link>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156488#M890282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are looking to get OnOpen Trigger. See if the link helps:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.qgate.co.uk/knowledge/adding-default-selections-in-qlikview/" title="http://www.qgate.co.uk/knowledge/adding-default-selections-in-qlikview/"&gt;Adding Default Selections in QlikView - The QGate Knowledgebase&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 13:02:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156488#M890282</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-08-23T13:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Date based on user selection</title>
      <link>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156489#M890283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can go about this in several ways, depending on your specific requirements:&lt;/P&gt;&lt;P&gt;1) Force a selection of the date field, combined with OnOpen triggers: select a single date, enter the list box properties, and check "Always one selected". Enter the document properties, select Triggers, and create an OnOpen trigger where the field is your date field and the value is =Today()-1 . This will automatically select yesterday, and force a single date to be selected at all times, displaying values for that date. It is relevant if you always want a specific date selected.&lt;/P&gt;&lt;P&gt;2) OnOpen trigger - use the latter part of the above to pre-select Today()-1. This will allow users to select any date range they want, but it will also allow them to clear the date selection entirely.&lt;/P&gt;&lt;P&gt;3) Set analysis - in this case, you will need a formula similar to what Sunny T describes in the original reply. Alternatively, you can create a script-level flag in your data based on the formula:&lt;/P&gt;&lt;P&gt;If(Date=Today()-1,1) as YesterdayFlag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, your formula would be something like:&lt;/P&gt;&lt;P&gt;If(GetSelectedCount(Date)=0,Value*YesterdayFlag,Value)&lt;/P&gt;&lt;P&gt;Which would only display yesterday's values unless something - anything - was selected in the Date field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope at least one of these helps.. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Aug 2016 13:12:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156489#M890283</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2016-08-23T13:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Date based on user selection</title>
      <link>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156490#M890284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello guys..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx a lot for the help. But lemme tell you nothing has been worked as of now in my application.I don't know what'll be the reason.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 06:49:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Assigning-Date-based-on-user-selection/m-p/1156490#M890284</guid>
      <dc:creator>sudhir0538</dc:creator>
      <dc:date>2016-08-24T06:49:21Z</dc:date>
    </item>
  </channel>
</rss>

