<?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: Creating filters based on last yr &amp; current yr mom comparison in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-filters-based-on-last-yr-current-yr-mom-comparison/m-p/81610#M13433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@&lt;STRONG style="font-size: 11.699999809265137px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;A href="https://community.qlik.com/people/ogautier62"&gt;ogautier62&lt;/A&gt;‌&lt;/STRONG&gt; Nice way around....Thanks &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; but the problem is that I have to do everything in backend as I had to give a filter only..&lt;/P&gt;&lt;P&gt;below is what I have done:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;divided data in 2 tables one which had data of 24-12 months[last year] &amp;amp; one that had data of 12-0 months [ current year]..&lt;/P&gt;&lt;P&gt;created a key in both tables using month &amp;amp; store code in both of the tables&lt;/P&gt;&lt;P&gt;Then created mapping table from last year having key &amp;amp; 'same' as storestatus&lt;/P&gt;&lt;P&gt;Done an apply map on the current year table --- giving the unmap codes as new &lt;/P&gt;&lt;P&gt;for the Old one...then concatenated the above current year table using last year table with condition where not exists(key) and stated old as store status...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This solved the issue &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 14 Jul 2018 18:03:05 GMT</pubDate>
    <dc:creator>salonibhatia</dc:creator>
    <dc:date>2018-07-14T18:03:05Z</dc:date>
    <item>
      <title>Creating filters based on last yr &amp; current yr mom comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-filters-based-on-last-yr-current-yr-mom-comparison/m-p/81608#M13431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi...I need to create a filter for my dashboard wherein I need to compare current year month&amp;nbsp; StoreCodes to last year month ones&lt;/P&gt;&lt;P&gt;and then create below 3 conditions&lt;/P&gt;&lt;P&gt;Same- if the store code exists in last year same month as current year ---say jan 2017 and jan 2018 have the same A store code&lt;/P&gt;&lt;P&gt;old--- if the store code does exists in last year in a&amp;nbsp; month say Jan but is not there in current year Jan month&lt;/P&gt;&lt;P&gt;new- if store code exists in current year in a month and was not there in last year same month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dummy data could be as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 261px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="21" width="87"&gt;Year&lt;/TD&gt;&lt;TD width="87"&gt;Month&lt;/TD&gt;&lt;TD width="87"&gt;StoreCode&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2016&lt;/TD&gt;&lt;TD&gt;Jan&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2016&lt;/TD&gt;&lt;TD&gt;Feb&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2016&lt;/TD&gt;&lt;TD&gt;Apr&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2016&lt;/TD&gt;&lt;TD&gt;Jun&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2017&lt;/TD&gt;&lt;TD&gt;Jan&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2017&lt;/TD&gt;&lt;TD&gt;Feb&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2017&lt;/TD&gt;&lt;TD&gt;Apr&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2017&lt;/TD&gt;&lt;TD&gt;Jun&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2017&lt;/TD&gt;&lt;TD&gt;Apr&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2017&lt;/TD&gt;&lt;TD&gt;Jun&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2018&lt;/TD&gt;&lt;TD&gt;Jan&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2018&lt;/TD&gt;&lt;TD&gt;Feb&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2018&lt;/TD&gt;&lt;TD&gt;Apr&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2018&lt;/TD&gt;&lt;TD&gt;Jun&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="21"&gt;2018&lt;/TD&gt;&lt;TD&gt;Jan&lt;/TD&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For year 2017, in the month of Jan Store code A exists in 2016 Jan &amp;amp; 2017 Jan thus it should be under same filter&lt;/P&gt;&lt;P&gt;I had tried using applymap based on a key created using year, month &amp;amp; Store code&amp;nbsp; in the mapping table and then created a column called last year using the year function[to get the same month last yr value] and created the same key in transaction table and got a flag but that gave me the data for same...what about new &amp;amp; old option??&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note-- I need to do this in backend only&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jun 2018 17:18:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-filters-based-on-last-yr-current-yr-mom-comparison/m-p/81608#M13431</guid>
      <dc:creator>salonibhatia</dc:creator>
      <dc:date>2018-06-26T17:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating filters based on last yr &amp; current yr mom comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-filters-based-on-last-yr-current-yr-mom-comparison/m-p/81609#M13432</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;in load try this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;store:&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; * FROM&amp;nbsp;&amp;nbsp; 'your data source'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load StoreCode, Month, Year, if(peek('StoreCode')=StoreCode and peek('Month')=Month and peek('Year')=Year-1,'Same','New') as flag&amp;nbsp;&amp;nbsp; resident store order by StoreCode,Month,Year;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so you have now :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/207018_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for 'Old' status, when you have a graph upon your Calendar,&lt;/P&gt;&lt;P&gt;replace null value for flag by 'old'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2018 07:19:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-filters-based-on-last-yr-current-yr-mom-comparison/m-p/81609#M13432</guid>
      <dc:creator>ogautier62</dc:creator>
      <dc:date>2018-07-05T07:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating filters based on last yr &amp; current yr mom comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-filters-based-on-last-yr-current-yr-mom-comparison/m-p/81610#M13433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@&lt;STRONG style="font-size: 11.699999809265137px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;A href="https://community.qlik.com/people/ogautier62"&gt;ogautier62&lt;/A&gt;‌&lt;/STRONG&gt; Nice way around....Thanks &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp; but the problem is that I have to do everything in backend as I had to give a filter only..&lt;/P&gt;&lt;P&gt;below is what I have done:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;divided data in 2 tables one which had data of 24-12 months[last year] &amp;amp; one that had data of 12-0 months [ current year]..&lt;/P&gt;&lt;P&gt;created a key in both tables using month &amp;amp; store code in both of the tables&lt;/P&gt;&lt;P&gt;Then created mapping table from last year having key &amp;amp; 'same' as storestatus&lt;/P&gt;&lt;P&gt;Done an apply map on the current year table --- giving the unmap codes as new &lt;/P&gt;&lt;P&gt;for the Old one...then concatenated the above current year table using last year table with condition where not exists(key) and stated old as store status...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This solved the issue &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Jul 2018 18:03:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-filters-based-on-last-yr-current-yr-mom-comparison/m-p/81610#M13433</guid>
      <dc:creator>salonibhatia</dc:creator>
      <dc:date>2018-07-14T18:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating filters based on last yr &amp; current yr mom comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-filters-based-on-last-yr-current-yr-mom-comparison/m-p/81611#M13434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Saloni,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Saw this post the other day, and just couldnt help myself not to work on it, as I really think this is a very good exercise about data modeling, even though I saw that you have already found your solution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per requirement, you are trying to create 3 fields named&lt;STRONG&gt; Same, Old, New&lt;/STRONG&gt; based on the following rules:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Same - If store-month appears in this year and last year&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Old - If store-month appears in last year only&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; New - If store-month appears in this year only&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above solution or the 3 fields represent the status of your Store-Month based on CurrentYear=2018 and LastYear=2017.&amp;nbsp; I was just wondering if user will want to know what will be the Store-Month status if CurrentYear=2017 and LastYear=2016.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g.&amp;nbsp; In Your Example, in Year 2016, you have 4 new Store-Month, and all of them will appear in New field, if user want to know what are the new Store-Month in Year 2016.&amp;nbsp; In Year 2017, all of the Store-Month status will be changed, for example, A-Jan and A-Jun will have status=SAME, but the other two will have status=OLD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="StoreCodeStatus.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/208059_StoreCodeStatus.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;If the Point in Time of your fact is not a concern and you only need to have the 3 field represent the Current Year/Last Year status, then just treat this as an alternative solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution that I suggest here is using the following technique:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Determine the StartYear and EndYear of a Store-Month&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Create the RefereneYears/PointInTimeYear for all Store-Month using IntervalMatch&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; Derive the status of each Store-Month based on the ReferenceYear/PointInTimeYear&lt;/P&gt;&lt;P&gt;4.&amp;nbsp; Instead of creating 3 Status field with Store Code as value, I'm created 1 Status Flag field for the purpose&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on the above example, if user want to know in Year 2017, what are the store-month have the status Old, this will be the solution screenshot:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="StoreCodeStatusQV.jpg" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/208060_StoreCodeStatusQV.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is the qvw file for the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2018 12:31:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-filters-based-on-last-yr-current-yr-mom-comparison/m-p/81611#M13434</guid>
      <dc:creator>David-Wong</dc:creator>
      <dc:date>2018-07-17T12:31:54Z</dc:date>
    </item>
  </channel>
</rss>

