<?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: Building Bar Charts using  TTM (Trailing Twelve Months) data sets in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Building-Bar-Charts-using-TTM-Trailing-Twelve-Months-data-sets/m-p/238401#M89288</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This task is easy if you have a trailing built on static time periods (the last 12 month from today) then you can calculate time based on Today() variable. But when we talk about dinamic approach things gets complicated. Here is an example I worked on lately. &lt;/P&gt;&lt;P&gt;sum({&amp;lt;MonthPeriod={&lt;/P&gt;&lt;P&gt;$(=&lt;SPAN id="yui_3_7_2_1_1373982022119_2119" style="font-weight: bold;"&gt;if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-1))&amp;amp;Num(Month(AddMonths(Today(),-1)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-1))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-1)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-1)),'00')))&lt;/SPAN&gt;),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp;&amp;nbsp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-2))&amp;amp;Num(Month(AddMonths(Today(),-2)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-2))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-2)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-2)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-3))&amp;amp;Num(Month(AddMonths(Today(),-3)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-3))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-3)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-3)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-4))&amp;amp;Num(Month(AddMonths(Today(),-4)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-4))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-4)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-4)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-5))&amp;amp;Num(Month(AddMonths(Today(),-5)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;&amp;nbsp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-5))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-5)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-5)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-6))&amp;amp;Num(Month(AddMonths(Today(),-6)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-6))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-6)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-6)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp;&amp;nbsp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-7))&amp;amp;Num(Month(AddMonths(Today(),-7)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-7))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-7)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-7)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-8))&amp;amp;Num(Month(AddMonths(Today(),-8)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-8))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-8)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-8)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-9))&amp;amp;Num(Month(AddMonths(Today(),-9)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-9))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-9)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-9)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-10))&amp;amp;Num(Month(AddMonths(Today(),-10)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;&amp;nbsp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-10))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-10)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-10)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-11))&amp;amp;Num(Month(AddMonths(Today(),-11)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-11))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-11)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-11)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp;&amp;nbsp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-12))&amp;amp;Num(Month(AddMonths(Today(),-12)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-12))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-12)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-12)),'00'))))},Month=,Year=&amp;gt;}AMOUNT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MonthPeriod is a format YYYYMM = '201307' which is in my time dimension. You need to build all the 12 functions in thae same object because if I create 12 variables the graph will not respond properly and become very unstable. I hope others have a better solution. Please let me know!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jul 2013 13:45:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-07-16T13:45:08Z</dc:date>
    <item>
      <title>Building Bar Charts using  TTM (Trailing Twelve Months) data sets</title>
      <link>https://community.qlik.com/t5/QlikView/Building-Bar-Charts-using-TTM-Trailing-Twelve-Months-data-sets/m-p/238398#M89285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone figured out how to create a bar graph for data sets of 12 months per bar for a twelve month period?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample would be:&lt;/P&gt;&lt;P&gt;October data set - reports from sept 2009 to oct 2010&lt;/P&gt;&lt;P&gt;November data set - reports from oct 2009 to nov 2010 ect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Oct 2010 03:46:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Building-Bar-Charts-using-TTM-Trailing-Twelve-Months-data-sets/m-p/238398#M89285</guid>
      <dc:creator />
      <dc:date>2010-10-15T03:46:27Z</dc:date>
    </item>
    <item>
      <title>Building Bar Charts using  TTM (Trailing Twelve Months) data sets</title>
      <link>https://community.qlik.com/t5/QlikView/Building-Bar-Charts-using-TTM-Trailing-Twelve-Months-data-sets/m-p/238399#M89286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've never seen this done, but I think you would need to create 12 expressions. Each expression would include a set analysis statement that would evaluate only the relevant 12 months. Example (October expression): sum({&amp;lt;date={"&amp;gt;=9/1/2009&amp;lt;=10/1/2010"}&amp;gt;} Sales). Of course, you can set this dynamically with variables that would update based on user selections.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Oct 2010 05:54:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Building-Bar-Charts-using-TTM-Trailing-Twelve-Months-data-sets/m-p/238399#M89286</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2010-10-15T05:54:18Z</dc:date>
    </item>
    <item>
      <title>Building Bar Charts using  TTM (Trailing Twelve Months) data sets</title>
      <link>https://community.qlik.com/t5/QlikView/Building-Bar-Charts-using-TTM-Trailing-Twelve-Months-data-sets/m-p/238400#M89287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you mean by 12 months per bar? Just the sum of the past 12 months, so a rolling 12 months? Or did you want the twelve months stacked, for instance? The most trivial approach would be to just set the expression to accumulation and accumulate 12 steps back, but I'm not sure if that's what you're after.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Oct 2010 19:20:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Building-Bar-Charts-using-TTM-Trailing-Twelve-Months-data-sets/m-p/238400#M89287</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-10-15T19:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Building Bar Charts using  TTM (Trailing Twelve Months) data sets</title>
      <link>https://community.qlik.com/t5/QlikView/Building-Bar-Charts-using-TTM-Trailing-Twelve-Months-data-sets/m-p/238401#M89288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This task is easy if you have a trailing built on static time periods (the last 12 month from today) then you can calculate time based on Today() variable. But when we talk about dinamic approach things gets complicated. Here is an example I worked on lately. &lt;/P&gt;&lt;P&gt;sum({&amp;lt;MonthPeriod={&lt;/P&gt;&lt;P&gt;$(=&lt;SPAN id="yui_3_7_2_1_1373982022119_2119" style="font-weight: bold;"&gt;if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-1))&amp;amp;Num(Month(AddMonths(Today(),-1)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-1))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-1)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-1)),'00')))&lt;/SPAN&gt;),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp;&amp;nbsp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-2))&amp;amp;Num(Month(AddMonths(Today(),-2)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-2))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-2)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-2)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-3))&amp;amp;Num(Month(AddMonths(Today(),-3)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-3))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-3)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-3)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-4))&amp;amp;Num(Month(AddMonths(Today(),-4)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-4))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-4)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-4)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-5))&amp;amp;Num(Month(AddMonths(Today(),-5)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;&amp;nbsp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-5))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-5)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-5)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-6))&amp;amp;Num(Month(AddMonths(Today(),-6)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-6))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-6)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-6)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp;&amp;nbsp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-7))&amp;amp;Num(Month(AddMonths(Today(),-7)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-7))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-7)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-7)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-8))&amp;amp;Num(Month(AddMonths(Today(),-8)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-8))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-8)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-8)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-9))&amp;amp;Num(Month(AddMonths(Today(),-9)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-9))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-9)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-9)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-10))&amp;amp;Num(Month(AddMonths(Today(),-10)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;&amp;nbsp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-10))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-10)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-10)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-11))&amp;amp;Num(Month(AddMonths(Today(),-11)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-11))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-11)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-11)),'00')))),&lt;/P&gt;&lt;P&gt;$(=if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)&amp;lt;&amp;gt;1, Year(AddMonths(GetFieldSelections(Year)&amp;amp;&amp;nbsp; '-'&amp;amp;Num(Month(AddMonths(Today(),-1)),'00')&amp;amp;'-01',-12))&amp;amp;Num(Month(AddMonths(Today(),-12)),'00'),if(GetSelectedCount(Year)=1 and GetSelectedCount(Month)=1, Year(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-12))&amp;amp;Num(Month(AddMonths(GetFieldSelections(Year)&amp;amp; '-'&amp;amp; Num(MONTH_IN_YEAR,'00')&amp;amp;'-01',-12)),'00'), Year(AddMonths(Today(),-1))&amp;amp; Num(Month(AddMonths(Today(),-12)),'00'))))},Month=,Year=&amp;gt;}AMOUNT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MonthPeriod is a format YYYYMM = '201307' which is in my time dimension. You need to build all the 12 functions in thae same object because if I create 12 variables the graph will not respond properly and become very unstable. I hope others have a better solution. Please let me know!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 13:45:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Building-Bar-Charts-using-TTM-Trailing-Twelve-Months-data-sets/m-p/238401#M89288</guid>
      <dc:creator />
      <dc:date>2013-07-16T13:45:08Z</dc:date>
    </item>
  </channel>
</rss>

