<?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: Show data from date range of current and previous year in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Show-data-from-date-range-of-current-and-previous-year/m-p/1675667#M63709</link>
    <description>&lt;P&gt;I think as your filters are date level and your expression should be filtered at date level to solve your problem.&lt;/P&gt;&lt;P&gt;I tried some formulas at my end may be it will work for you. I applied date format to make my formula work in my case. apply date format according to your requirement.&lt;/P&gt;&lt;P&gt;another thing is CY YTD made to take dynamic values ($) and PY YTD applied constant selection (1).&lt;/P&gt;&lt;P&gt;Hope this helps:&lt;/P&gt;&lt;P&gt;CY YTD:&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;his_date={"&amp;gt;=$(=DATE(YearStart(Max(his_date)),'YYYY-MM-DD'))&amp;lt;=$(=Max(his_date))"}&amp;gt;} quantity_rooms)&lt;/P&gt;&lt;P&gt;PY YTD:&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUM({1&amp;lt;his_date={"&amp;gt;=$(=DATE(AddYears(YearStart(Max(his_date)),-1),'YYYY-MM-DD'))&amp;lt;=$(=DATE(AddYears(Max(his_date),-1),'YYYY-MM-DD'))"}&amp;gt;} quantity_rooms)&lt;/P&gt;</description>
    <pubDate>Fri, 14 Feb 2020 07:39:07 GMT</pubDate>
    <dc:creator>srdheekonda</dc:creator>
    <dc:date>2020-02-14T07:39:07Z</dc:date>
    <item>
      <title>Show data from date range of current and previous year</title>
      <link>https://community.qlik.com/t5/App-Development/Show-data-from-date-range-of-current-and-previous-year/m-p/1675598#M63708</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;Lately I'm having this issue&amp;nbsp; whenever&amp;nbsp; someone selects&amp;nbsp; an specific date or date range from this &lt;FONT color="#3366FF"&gt;year&lt;/FONT&gt; in any of&amp;nbsp; the charts from the dashboard that supposedly have to show the same data but from the &lt;FONT color="#800080"&gt;previous year&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;I don't know why but at the beginning it was working fine (only when I selected a&lt;FONT color="#3366FF"&gt; year &lt;FONT color="#000000"&gt;from the year filter&lt;/FONT&gt;&lt;/FONT&gt;), but&amp;nbsp;but now it doesn't seems&amp;nbsp; work anymore.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ejemplo 1" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/28404i7E3B8378B7463DF1/image-size/large?v=v2&amp;amp;px=999" role="button" title="ejemplo 1.png" alt="ejemplo 1" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;ejemplo 1&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The field that I'm using fot the Year filter is this one:&amp;nbsp;=&lt;FONT color="#993300"&gt;[his_date.autoCalendar.Year]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;This is the expression that I'm using to calculate the values:&amp;nbsp;&lt;/P&gt;&lt;P&gt;=&lt;FONT color="#3366FF"&gt;Sum&lt;/FONT&gt; ( {&lt;FONT color="#3366FF"&gt;$&lt;/FONT&gt;&amp;lt;&lt;FONT color="#993300"&gt;hist_y_otb&lt;/FONT&gt;={&lt;FONT color="#339966"&gt;"History"&lt;/FONT&gt;}, &lt;FONT color="#993300"&gt;[his_date.autoCalendar.Year]&lt;/FONT&gt;={$(#=Max(Year)-1)}&amp;gt;} &lt;FONT color="#993300"&gt;quantity_rooms&lt;/FONT&gt; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, when I don't have any filter selected it gaves me the desired result (2020 / 2019):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ejemplo 3" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/28405i539872C57CBA3461/image-size/large?v=v2&amp;amp;px=999" role="button" title="ejemplo 3.png" alt="ejemplo 3" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;ejemplo 3&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;In the other when I select only one month or one date, I get this result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ejemplo 2" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/28408i1FE3224535B50A9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="ejemplo 2.png" alt="ejemplo 2" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;ejemplo 2&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I would like it to show the data from the same dates of the year/period selected and the previous year.&amp;nbsp; How can I accomplish this?&lt;/P&gt;&lt;P&gt;Thanks for the help!!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 08:19:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-data-from-date-range-of-current-and-previous-year/m-p/1675598#M63708</guid>
      <dc:creator>Realmoca</dc:creator>
      <dc:date>2021-04-02T08:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Show data from date range of current and previous year</title>
      <link>https://community.qlik.com/t5/App-Development/Show-data-from-date-range-of-current-and-previous-year/m-p/1675667#M63709</link>
      <description>&lt;P&gt;I think as your filters are date level and your expression should be filtered at date level to solve your problem.&lt;/P&gt;&lt;P&gt;I tried some formulas at my end may be it will work for you. I applied date format to make my formula work in my case. apply date format according to your requirement.&lt;/P&gt;&lt;P&gt;another thing is CY YTD made to take dynamic values ($) and PY YTD applied constant selection (1).&lt;/P&gt;&lt;P&gt;Hope this helps:&lt;/P&gt;&lt;P&gt;CY YTD:&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt;his_date={"&amp;gt;=$(=DATE(YearStart(Max(his_date)),'YYYY-MM-DD'))&amp;lt;=$(=Max(his_date))"}&amp;gt;} quantity_rooms)&lt;/P&gt;&lt;P&gt;PY YTD:&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUM({1&amp;lt;his_date={"&amp;gt;=$(=DATE(AddYears(YearStart(Max(his_date)),-1),'YYYY-MM-DD'))&amp;lt;=$(=DATE(AddYears(Max(his_date),-1),'YYYY-MM-DD'))"}&amp;gt;} quantity_rooms)&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 07:39:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-data-from-date-range-of-current-and-previous-year/m-p/1675667#M63709</guid>
      <dc:creator>srdheekonda</dc:creator>
      <dc:date>2020-02-14T07:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Show data from date range of current and previous year</title>
      <link>https://community.qlik.com/t5/App-Development/Show-data-from-date-range-of-current-and-previous-year/m-p/1675919#M63710</link>
      <description>&lt;P&gt;Hello &amp;nbsp;Srdheekonda,&lt;/P&gt;&lt;P&gt;Thank you very much for your prompt answer!&lt;/P&gt;&lt;P&gt;I tried with the recommendations that you gave me and it didn't seems to work. I don´t know why because I think that your&amp;nbsp;approaching is the right one, it has to be related to data level and the expression that I'm using should be&amp;nbsp;&lt;SPAN&gt;filtered at date level.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example 4" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/28461i63AD5B51DED6808A/image-size/large?v=v2&amp;amp;px=999" role="button" title="ejemplo 4.png" alt="example 4" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;example 4&lt;/span&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I don't know if it's important but I'm using the generated auto calendar fields to filter for year (&lt;FONT color="#993300"&gt;[his_date.autoCalendar.Year]&lt;/FONT&gt;), quarter (&lt;FONT color="#993300"&gt;[his_date.autoCalendar.Quarter]&lt;/FONT&gt;) and month (&lt;FONT color="#993300"&gt;[his_date.autoCalendar.Month]&lt;/FONT&gt;) from the field &lt;FONT color="#993300"&gt;his_date&lt;FONT color="#000000"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have reviewed the forum and some websites and tried to use the recommendations and solutions, but I couldn't make it work. There is one the &lt;FONT color="#0000FF"&gt;As of Table&lt;/FONT&gt; but I don't know how to apply it&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you need me to share anything more like more info.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 21:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-data-from-date-range-of-current-and-previous-year/m-p/1675919#M63710</guid>
      <dc:creator>Realmoca</dc:creator>
      <dc:date>2020-02-14T21:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Show data from date range of current and previous year</title>
      <link>https://community.qlik.com/t5/App-Development/Show-data-from-date-range-of-current-and-previous-year/m-p/1676898#M63711</link>
      <description>&lt;P&gt;I think&amp;nbsp; you can use AutoCalendarDate&amp;nbsp; and format accordingly if there is any issues with Date Format.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 06:19:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-data-from-date-range-of-current-and-previous-year/m-p/1676898#M63711</guid>
      <dc:creator>srdheekonda</dc:creator>
      <dc:date>2020-02-19T06:19:58Z</dc:date>
    </item>
  </channel>
</rss>

