<?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: Date value in a variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529915#M198079</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understand, the table was just to check some data, the formula is in the text box. Eg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to select the date 01/05/2011 in the text box shows 12Apr10, it´s the max date &lt;SPAN style="font-size: 10pt;"&gt;of the previous year(2010)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;to select the date 12/07/2012 in the text box shows 17May11, it´s the max date &lt;SPAN style="font-size: 10pt;"&gt;of the previous year(2011).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;to select the date 22/07/2013 in the text box shows 25Jul12, it´s the max date &lt;SPAN style="font-size: 10pt;"&gt;of the previous year(2012).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;to select the date 25/03/2010 in the text box shows null '-', because not exists information for previous year(2009)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Please, You verify.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Jul 2013 23:34:07 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-07-26T23:34:07Z</dc:date>
    <item>
      <title>Date value in a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529908#M198072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying to assign a vlaue to a variable that should be the maximum available date of previous year based on user selected date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Date(max({&amp;lt;P_Year={"$(=year(P_Date)-1)"}&amp;gt;} P_Date),'DDMMMYY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, I get previous year and then get the maximum date of that year. Due to some reason, I do not get any reult.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 15:55:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529908#M198072</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-26T15:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Date value in a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529909#M198073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure P_Date contains real date values, i.e. numbers, not string values. Check that =num(P_Date) returns a number if you select one P_Date. If P_Date contains strings you'll have to use the date# function to create a date from that string first. It's best if you do that conversion in the load script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 16:07:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529909#M198073</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-07-26T16:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Date value in a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529910#M198074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;P_Date contains real date values. I changed it to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Date(Max({1&amp;lt;P_Year={"$(=Year(AddYears(P_Date,-1)))"}&amp;gt;} P_Date),'DDMMMYY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works only if I have '1' in set expression but now I only get one max date for all regions. I wanted separate max date for each.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 16:29:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529910#M198074</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-26T16:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Date value in a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529911#M198075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you add a column year of date? Maybe It can help you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 17:34:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529911#M198075</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-26T17:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Date value in a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529912#M198076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrea, I was able to get to this point. But the issue is I get max date for every situation as one date e.g. July 25th in your example, I need it flexible, if user selects any date from the list box, this should change accordingly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 18:02:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529912#M198076</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-26T18:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Date value in a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529913#M198077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/arsalanam" id="jive-9294728247313823063390" style="background-color: #ffffff; font-size: 12px; color: #007fc0; font-weight: bold; font-family: Arial; text-align: center;"&gt;arsalanam&lt;/A&gt;, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I add new values to that you see the chage according the date selected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You select dates the differents years.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 20:04:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529913#M198077</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-26T20:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Date value in a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529914#M198078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you for your help Andrea!&lt;BR /&gt;But i'm trying to get max date of previous year for any selected date, your attached file shows max date of same year.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 21:07:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529914#M198078</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-26T21:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Date value in a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529915#M198079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understand, the table was just to check some data, the formula is in the text box. Eg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to select the date 01/05/2011 in the text box shows 12Apr10, it´s the max date &lt;SPAN style="font-size: 10pt;"&gt;of the previous year(2010)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;to select the date 12/07/2012 in the text box shows 17May11, it´s the max date &lt;SPAN style="font-size: 10pt;"&gt;of the previous year(2011).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;to select the date 22/07/2013 in the text box shows 25Jul12, it´s the max date &lt;SPAN style="font-size: 10pt;"&gt;of the previous year(2012).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;to select the date 25/03/2010 in the text box shows null '-', because not exists information for previous year(2009)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Please, You verify.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 23:34:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529915#M198079</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-26T23:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Date value in a variable</title>
      <link>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529916#M198080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much, it helped a lot. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm facing a strange situation. I get a date for last region (middke column) which is different from rest but when i put it in the expression, I do not get any value. Screen shot attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Middle column gives correct values (as you suggested):&lt;BR /&gt;=Date(max({1&amp;lt;C_Year={$(=Max(C_Year)-1)}&amp;gt;} C_Date),'DDMMMYY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last column which works fine for rest but not for last row:&lt;/P&gt;&lt;P&gt;=(Num_Field+1)/(only({&amp;lt;C_Date={"$(=Date(max({1&amp;lt;C_Year={$(=Max(C_Year)-1)}&amp;gt;} C_Date),'DDMMMYY'))"}&amp;gt;}Num_Field)+1)-1&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;IMG __jive_id="44680" class="jive-image-thumbnail jive-image" onclick="" alt="Data.jpg" src="https://community.qlik.com/legacyfs/online/44680_Data.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2013 19:31:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-value-in-a-variable/m-p/529916#M198080</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-29T19:31:50Z</dc:date>
    </item>
  </channel>
</rss>

