<?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 Combine Total Year with current year months in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Combine-Total-Year-with-current-year-months/m-p/828229#M532345</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a requirement to combine previous years with current year months.&amp;nbsp; Does anyone have an example of this?&amp;nbsp; I've placed a picture of what the business would like to see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Kim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 May 2015 14:17:35 GMT</pubDate>
    <dc:creator>kstroupe</dc:creator>
    <dc:date>2015-05-21T14:17:35Z</dc:date>
    <item>
      <title>Combine Total Year with current year months</title>
      <link>https://community.qlik.com/t5/QlikView/Combine-Total-Year-with-current-year-months/m-p/828229#M532345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a requirement to combine previous years with current year months.&amp;nbsp; Does anyone have an example of this?&amp;nbsp; I've placed a picture of what the business would like to see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Kim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 14:17:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Combine-Total-Year-with-current-year-months/m-p/828229#M532345</guid>
      <dc:creator>kstroupe</dc:creator>
      <dc:date>2015-05-21T14:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Combine Total Year with current year months</title>
      <link>https://community.qlik.com/t5/QlikView/Combine-Total-Year-with-current-year-months/m-p/828230#M532346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I usually handle that in the data model by creating a date table with the custom buckets (Years and Months in the same field so that the chart creating is very straight forward)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//load your main data. It includes a Date field.&amp;nbsp; Create a year/month key because we will be including both years and months in the xAxis dimension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Transaction ID],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Salesman ID],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Product ID],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Serial No],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Customer ID],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [List Price],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Gross Margin],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(Date)&amp;amp;month(Date) as YearMonthKey&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//code to figure out the max(year) in your data set&lt;/P&gt;&lt;P&gt;MaxYearTable:&lt;/P&gt;&lt;P&gt;load Distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp; max(year(Date)) as MaxYear&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;let vMaxYear=peek('MaxYear',0,'MaxYearTable');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;drop table MaxYearTable;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Build a table with a new x-axis chart dimension. First load months from previous years. The x-axis values are previous year values&lt;/P&gt;&lt;P&gt;ChartTable:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp; YearMonthKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Year(Date) as xAxisDimension,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Year(Date) as xAxisSortNumber&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where Year(Date) &amp;lt; $(vMaxYear);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//now add current year months, the x-axis values are months from the current year. add a sort key to ensure the x-axis values are sorted how you want&lt;/P&gt;&lt;P&gt;Concatenate (ChartTable)&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; YearMonthKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp; text(Month(Date)) as xAxisDimension,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Year(Date)+Month(Date) as xAxisSortNumber&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where&amp;nbsp; Year(Date) = $(vMaxYear);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//load rest of your data&lt;/P&gt;&lt;P&gt;LOAD Country,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Region&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD [Customer ID],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Address,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; City,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Zip,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Country&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 14:37:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Combine-Total-Year-with-current-year-months/m-p/828230#M532346</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-05-21T14:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Combine Total Year with current year months</title>
      <link>https://community.qlik.com/t5/QlikView/Combine-Total-Year-with-current-year-months/m-p/828231#M532347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You I will try that and let you know how it goes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 14:52:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Combine-Total-Year-with-current-year-months/m-p/828231#M532347</guid>
      <dc:creator>kstroupe</dc:creator>
      <dc:date>2015-05-21T14:52:06Z</dc:date>
    </item>
  </channel>
</rss>

