<?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: Need help with latest year flag in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52984#M767704</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But the above expression doesn't work in script rite ? as per your question you needed something in the script level !!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jun 2018 09:59:04 GMT</pubDate>
    <dc:creator>avinashelite</dc:creator>
    <dc:date>2018-06-20T09:59:04Z</dc:date>
    <item>
      <title>Need help with latest year flag</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52980#M767699</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;Trying to create a simple flag in a calendar that filters the date between the last date of the previous month (so 2018-05-31 if max date = today) and the first day of the current month - 12 months (so 2017-06-01 if max date = today). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should be dependent upon the max date in the selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this in script and I only get errors and I dont understand why. When i tried the functions in text box they returned correct values....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Date&amp;gt;=MonthStart(Max(Date), - 12) and Date&amp;lt;=MonthEnd(Addmonths(Max(Date),-1)),'1') as LatestYear&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/Need-help-with-latest-year-flag/m-p/52980#M767699</guid>
      <dc:creator>joeallen</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with latest year flag</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52981#M767700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot use max directly in the script ....try like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;if(Date&amp;gt;=MonthStart(today(), - 12) and Date&amp;lt;=MonthEnd(Addmonths(&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;today()&lt;/SPAN&gt;,-1)),'1') as LatestYear&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 09:31:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52981#M767700</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2018-06-20T09:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with latest year flag</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52982#M767701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to make it run based on the month selection, then you should write this logic on the UI and not on backend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try like this: Create a variable in variable overview&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;vMaxDate= max(Date)&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;Then expression:&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;sum({&amp;lt;Date={'&amp;gt;=$(=date(monthstart(Addmonths($(vMaxDate),-12)))'}&amp;lt;=$(date(monthend(Addmonths($(vMaxDate),-1)))'}&amp;gt;}Sales)&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;Note: Make sure the date format is correct&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Br,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;KC&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 09:35:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52982#M767701</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2018-06-20T09:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with latest year flag</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52983#M767702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jyothish. That works well for a more dynamic solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 09:39:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52983#M767702</guid>
      <dc:creator>joeallen</dc:creator>
      <dc:date>2018-06-20T09:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with latest year flag</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52984#M767704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But the above expression doesn't work in script rite ? as per your question you needed something in the script level !!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 09:59:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52984#M767704</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2018-06-20T09:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with latest year flag</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52985#M767705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;He wanted a expression which changes on the month selection he does on the UI also, so i suggested him to do it on the UI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;KC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 10:01:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52985#M767705</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2018-06-20T10:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with latest year flag</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52986#M767706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/108195"&gt;jyothish8807&lt;/A&gt; your answer is correct &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; I feel he question made the confusion &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 10:04:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52986#M767706</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2018-06-20T10:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with latest year flag</title>
      <link>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52987#M767707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ya bro &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 10:06:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-help-with-latest-year-flag/m-p/52987#M767707</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2018-06-20T10:06:54Z</dc:date>
    </item>
  </channel>
</rss>

