<?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 Lining up dates between 2 years in graphs in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Lining-up-dates-between-2-years-in-graphs/m-p/1747336#M506238</link>
    <description>&lt;P&gt;I'm wondering if there is a way to better line up dates between years.&amp;nbsp; When I want to show trends by comparing 2 years, if I do it at the day of week level of granularity, the current year obviously won't line up with the previous year.&amp;nbsp; The attached helps explain it.&amp;nbsp; &amp;nbsp;I want to show the full 7 days of last week from this year and also the same full week last year.&amp;nbsp; I have flags set in my calendars to bucket my dates and then use those flags in set analysis.... ie, LastWeek={1} and LastWeek_LastYr={1}.&amp;nbsp; &amp;nbsp;Maybe the way I built my flags is incorrect.&amp;nbsp; Maybe I'm missing something else here?&amp;nbsp; This looks particularly bad/odd because the weeks shown here are Aug 31-Sep 6 for 2020 and Aug 26-Sep 1 2019, because that is how the this year vs last year lined up.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="dates dif yrs.GIF" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41249i56BCC8518C9563C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="dates dif yrs.GIF" alt="dates dif yrs.GIF" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 23:54:53 GMT</pubDate>
    <dc:creator>kdmarkee</dc:creator>
    <dc:date>2024-11-15T23:54:53Z</dc:date>
    <item>
      <title>Lining up dates between 2 years in graphs</title>
      <link>https://community.qlik.com/t5/QlikView/Lining-up-dates-between-2-years-in-graphs/m-p/1747336#M506238</link>
      <description>&lt;P&gt;I'm wondering if there is a way to better line up dates between years.&amp;nbsp; When I want to show trends by comparing 2 years, if I do it at the day of week level of granularity, the current year obviously won't line up with the previous year.&amp;nbsp; The attached helps explain it.&amp;nbsp; &amp;nbsp;I want to show the full 7 days of last week from this year and also the same full week last year.&amp;nbsp; I have flags set in my calendars to bucket my dates and then use those flags in set analysis.... ie, LastWeek={1} and LastWeek_LastYr={1}.&amp;nbsp; &amp;nbsp;Maybe the way I built my flags is incorrect.&amp;nbsp; Maybe I'm missing something else here?&amp;nbsp; This looks particularly bad/odd because the weeks shown here are Aug 31-Sep 6 for 2020 and Aug 26-Sep 1 2019, because that is how the this year vs last year lined up.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="dates dif yrs.GIF" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/41249i56BCC8518C9563C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="dates dif yrs.GIF" alt="dates dif yrs.GIF" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:54:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lining-up-dates-between-2-years-in-graphs/m-p/1747336#M506238</guid>
      <dc:creator>kdmarkee</dc:creator>
      <dc:date>2024-11-15T23:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lining up dates between 2 years in graphs</title>
      <link>https://community.qlik.com/t5/QlikView/Lining-up-dates-between-2-years-in-graphs/m-p/1747350#M506239</link>
      <description>&lt;P&gt;The way i would associate different time periods is by using a bridge.&amp;nbsp; i would associate different years by a weekIndex (the numerical number of the week in the year) and a Day number (Monday=0, etc).&lt;BR /&gt;i would associate the current year with the prior year using these two dimensions this way:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NoConcatenate
tmpPriorYear:  //this gets the dates its day, week, and year
load
	Date,
	DayNum,
	WeekIndex,
	Year
Resident
	Calendar
;


inner join (tmpPriorYear)  //inner join it with itself (cartesian join)
                           //on DayNum and WeekIndex across years
load
	Date as PriorDate,
	DayNum,
	WeekIndex,
	Year as PriorYear
Resident
	tmpPriorYear
;

Concatenate (Bridge)
load
	Date,
	DayNum as WeekDayNum,
	WeekIndex as xWeekIndex,
	Year as xYear,
	PriorDate as FactDate,
	PriorYear,
	'PRIOR' as DateType
Resident
	tmpPriorYear
where 
	PriorYear=Year-1  //this filters for only prior years
                          //other rows are discarded
;

drop table tmpPriorYear;&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 26 Sep 2020 02:55:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lining-up-dates-between-2-years-in-graphs/m-p/1747350#M506239</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2020-09-26T02:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lining up dates between 2 years in graphs</title>
      <link>https://community.qlik.com/t5/QlikView/Lining-up-dates-between-2-years-in-graphs/m-p/1748858#M506240</link>
      <description>&lt;P&gt;Thanks for the suggestion. I will try it and let you know how it goes.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 13:46:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lining-up-dates-between-2-years-in-graphs/m-p/1748858#M506240</guid>
      <dc:creator>kdmarkee</dc:creator>
      <dc:date>2020-10-01T13:46:44Z</dc:date>
    </item>
  </channel>
</rss>

