<?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: Using Year Function in Set Analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-Year-Function-in-Set-Analysis/m-p/2462647#M98985</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/238934"&gt;@AJ2024&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Do you have a Year field based on the date in your datamodel?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then use&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;=Sum({$&amp;lt; Year&lt;/SPAN&gt;&lt;SPAN&gt;={2020} &amp;gt;}[Measure])&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Based on a date DD-MM-YYYY you could use&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;=Sum({$&amp;lt; [Date Field]&lt;/SPAN&gt;&lt;SPAN&gt;={"*-2020"} &amp;gt;}[Measure])&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="AddMessageTags lia-message-tags lia-component-message-view-widget-tags"&gt;It's better to create a Year field&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Year(&lt;SPAN&gt;[Date Field]) AS Year&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make it dynamic, select the max value of YEAR&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;=Sum({$&amp;lt; Year={"=$(=MAX(Year))"} &amp;gt;}[Measure])&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;Last Year&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;=Sum({$&amp;lt; Year={"=$(=MAX(Year)-1)"} &amp;gt;}[Measure])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="AddMessageTags lia-message-tags lia-component-message-view-widget-tags"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jun 2024 14:56:28 GMT</pubDate>
    <dc:creator>p_verkooijen</dc:creator>
    <dc:date>2024-06-14T14:56:28Z</dc:date>
    <item>
      <title>Using Year Function in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Using-Year-Function-in-Set-Analysis/m-p/2462646#M98984</link>
      <description>&lt;P&gt;Looking for help on syntax to use the Year function in set analysis. How do I need to modify the expression below to make it work?&lt;/P&gt;
&lt;P&gt;=Sum({$&amp;lt;&lt;U&gt;&lt;STRONG&gt;Year&lt;/STRONG&gt;&lt;/U&gt;([Date Field])={2020}&amp;gt;}[Measure])&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 14:51:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-Year-Function-in-Set-Analysis/m-p/2462646#M98984</guid>
      <dc:creator>AJ2024</dc:creator>
      <dc:date>2024-06-14T14:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using Year Function in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Using-Year-Function-in-Set-Analysis/m-p/2462647#M98985</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/238934"&gt;@AJ2024&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Do you have a Year field based on the date in your datamodel?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then use&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;=Sum({$&amp;lt; Year&lt;/SPAN&gt;&lt;SPAN&gt;={2020} &amp;gt;}[Measure])&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Based on a date DD-MM-YYYY you could use&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;=Sum({$&amp;lt; [Date Field]&lt;/SPAN&gt;&lt;SPAN&gt;={"*-2020"} &amp;gt;}[Measure])&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="AddMessageTags lia-message-tags lia-component-message-view-widget-tags"&gt;It's better to create a Year field&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;Year(&lt;SPAN&gt;[Date Field]) AS Year&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make it dynamic, select the max value of YEAR&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;=Sum({$&amp;lt; Year={"=$(=MAX(Year))"} &amp;gt;}[Measure])&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;Last Year&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;=Sum({$&amp;lt; Year={"=$(=MAX(Year)-1)"} &amp;gt;}[Measure])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="AddMessageTags lia-message-tags lia-component-message-view-widget-tags"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 14:56:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-Year-Function-in-Set-Analysis/m-p/2462647#M98985</guid>
      <dc:creator>p_verkooijen</dc:creator>
      <dc:date>2024-06-14T14:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using Year Function in Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Using-Year-Function-in-Set-Analysis/m-p/2462649#M98986</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28986"&gt;@p_verkooijen&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I don't have a year field in the data model currently but that sounds like the better solution. I'll go ahead and add it. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 15:00:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-Year-Function-in-Set-Analysis/m-p/2462649#M98986</guid>
      <dc:creator>AJ2024</dc:creator>
      <dc:date>2024-06-14T15:00:26Z</dc:date>
    </item>
  </channel>
</rss>

