<?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 Set analysis date range from last year in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101586#M6775</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the Sense Date Range Picker to select the sum of sales from an specific date range, and it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I was asked to add last year comparisson (ie, if I am seeing sum of sales from October 15 to October 21, 2018, then they want the sum of the sales&amp;nbsp; from October 15 to October 21, 2017 in the next column).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried set analysis and it seems to work when i am not using the date range picker, however when I select a date range it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have done is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Declare two variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp; vMaxSelect =Num(AddYears(Max(Fecha), -1)) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp; vMinSelect =Num(AddYears(Min(Fecha), -1)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use this formula in a straight table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =Sum({&amp;lt;Fecha = {"&amp;gt;=$(vMinSelect)&amp;lt;=$(vMaxSelect)"}&amp;gt;} $(vVenta))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Associate dimension "Fecha" to date range picker and select a date range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Nov 2018 22:10:54 GMT</pubDate>
    <dc:creator>agustapia</dc:creator>
    <dc:date>2018-11-01T22:10:54Z</dc:date>
    <item>
      <title>Set analysis date range from last year</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101586#M6775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the Sense Date Range Picker to select the sum of sales from an specific date range, and it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I was asked to add last year comparisson (ie, if I am seeing sum of sales from October 15 to October 21, 2018, then they want the sum of the sales&amp;nbsp; from October 15 to October 21, 2017 in the next column).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried set analysis and it seems to work when i am not using the date range picker, however when I select a date range it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have done is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Declare two variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp; vMaxSelect =Num(AddYears(Max(Fecha), -1)) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp; vMinSelect =Num(AddYears(Min(Fecha), -1)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use this formula in a straight table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =Sum({&amp;lt;Fecha = {"&amp;gt;=$(vMinSelect)&amp;lt;=$(vMaxSelect)"}&amp;gt;} $(vVenta))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Associate dimension "Fecha" to date range picker and select a date range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2018 22:10:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101586#M6775</guid>
      <dc:creator>agustapia</dc:creator>
      <dc:date>2018-11-01T22:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis date range from last year</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101587#M6776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Agustin. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Most likely, it is necessary to ignore selections in the field made by &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;the date range picker&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;, in other words in all period fields except &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;"Fecha"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 03:52:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101587#M6776</guid>
      <dc:creator>andrey_krylov</dc:creator>
      <dc:date>2018-11-02T03:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis date range from last year</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101588#M6777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum({&amp;lt;Month = {"&amp;lt;=$(=num(Month))"}, Year = {&amp;nbsp; $(=(Year) - 1)}&amp;gt;} $(vVenta))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Month field is Jan, Feb, Mar etc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Year field is 2017,2018 etc..&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 11:47:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101588#M6777</guid>
      <dc:creator>MK9885</dc:creator>
      <dc:date>2018-11-02T11:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis date range from last year</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101589#M6778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but not working neither...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2018 16:59:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101589#M6778</guid>
      <dc:creator>agustapia</dc:creator>
      <dc:date>2018-11-05T16:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis date range from last year</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101590#M6779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrey, I did made a dummy dimension of date (same data, different name) from data load editor but it didn't work. Can you please be more specific (maybe a little example of what should I do)? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2018 17:01:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101590#M6779</guid>
      <dc:creator>agustapia</dc:creator>
      <dc:date>2018-11-05T17:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis date range from last year</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101591#M6780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Hi Agustin. As you said above your expression works fine while you are &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;not using the date range picker, so the only thing is to be done is ignoring other selections. If there is a master calendar I would add all of its fields to set analysis&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; =Sum({&amp;lt;Fecha = {"&amp;gt;=$(vMinSelect)&amp;lt;=$(vMaxSelect) , Month, Year, &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;PeriodField1, &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;PeriodField2,&lt;/SPAN&gt;.. &lt;/SPAN&gt;"}&amp;gt;} $(vVenta))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;or at least that used by the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date picker as well as those in charts, listboxes...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;When you set a period in one field using set analysis it does not ignore selections in other date fields and you've to overide them in set analysis as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2018 19:29:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101591#M6780</guid>
      <dc:creator>andrey_krylov</dc:creator>
      <dc:date>2018-11-05T19:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis date range from last year</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101592#M6781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was a tricky one, as your solution did not work because Fecha is the variable I need to ignore and is also the one over which the selection is made, so a simple set analysis without ignoring any other variable should have been enough, but it wasn't. Also adding Fecha in the end of the set analysis to ignore it didn't make it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution came by adding a 1 before set analysis formula to ignore all filters, I still don't understand why my original formula is not working, but at least now I have a solution to the issue I had.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really appreciate your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Nov 2018 21:17:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101592#M6781</guid>
      <dc:creator>agustapia</dc:creator>
      <dc:date>2018-11-05T21:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis date range from last year</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101593#M6782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wanted to get back to you to let you know that, for some reasons I realized that Date Range Picker was not making a selection over my Fecha field, but over a transformation of it that showed the correct time stamp for the Picker to work. Then when I did the transformations in the data load editor for my field Fecha to be used in the Date Range Picker without transformations, the set analysis worked without any of the tricks we were talking about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No doubt that every day we can learn something new...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the support...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2018 15:38:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-date-range-from-last-year/m-p/101593#M6782</guid>
      <dc:creator>agustapia</dc:creator>
      <dc:date>2018-11-09T15:38:44Z</dc:date>
    </item>
  </channel>
</rss>

