<?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: Month over Month w/ Variable in Set Expression. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Month-over-Month-w-Variable-in-Set-Expression/m-p/811162#M1043106</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Pete,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be helpful if you added more detail on your desired outcome.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;A few blind considerations -- You should create a 'MonthYearID' so there is a unique value for each and your expression isn't so &lt;/SPAN&gt;convoluted&lt;SPAN style="line-height: 19.5px; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Year(Month) - 1) * 12 + Num(Month(Month)) in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might want to consider looking into creating a master calendar as well, unless every date is covered in your XLS file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe you need to use the max( function in order to retrieve the last month based on the selection.&amp;nbsp; Think about it from the user perspective -- if they select 2012 and your set mod is month=month -- how does qlikview know what to default to?&amp;nbsp; max() gives you the max value based on what is selected (as long as you use the $ identifier).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Nov 2014 22:43:14 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-24T22:43:14Z</dc:date>
    <item>
      <title>Month over Month w/ Variable in Set Expression.</title>
      <link>https://community.qlik.com/t5/QlikView/Month-over-Month-w-Variable-in-Set-Expression/m-p/811161#M1043105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to compare the month selected by the user with the month prior to the one they selected.&amp;nbsp; I am not getting any data, but I am also not getting any errors.&amp;nbsp; New to all this and need some help. I am using Qlik Sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Expression I am using - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum( {$&amp;lt;Month={$(=vMonth)},Year=&amp;gt;} Pageviews) + &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;sum({$&amp;lt;Month={$(=Month(AddMonths(vMonth,-1)))},Year={$(=Year(AddMonths(now(),-1)))}&amp;gt;}Pageviews)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD SCRIPT - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET ThousandSep=',';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET DecimalSep='.';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET MoneyThousandSep=',';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET MoneyDecimalSep='.';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET MoneyFormat='$#,##0.00;($#,##0.00)';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET TimeFormat='h:mm:ss TT';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET DateFormat='MM/DD/YYYY';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET TimestampFormat='MM/DD/YYYY';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET FirstWeekDay=6;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET BrokenWeeks=1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET ReferenceDay=0;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET FirstMonthOfYear=1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET CollationLocale='en-US';&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET vMonth = GetFieldSelections(Month)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(Month)as Month,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dual('Q' &amp;amp; ceil(Month(Month)/3), &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ceil(month(Month)/3)) as Quarter,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(Month) as Year,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Day Index",&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pageviews&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FROM [lib://Retainer Client Reports/Monthly Retainer Report_Superior Hire.xlsx]&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(ooxml, embedded labels, table is [GA - Behaiv_Site_All2]);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 22:01:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-over-Month-w-Variable-in-Set-Expression/m-p/811161#M1043105</guid>
      <dc:creator />
      <dc:date>2014-11-24T22:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Month over Month w/ Variable in Set Expression.</title>
      <link>https://community.qlik.com/t5/QlikView/Month-over-Month-w-Variable-in-Set-Expression/m-p/811162#M1043106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Pete,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be helpful if you added more detail on your desired outcome.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;A few blind considerations -- You should create a 'MonthYearID' so there is a unique value for each and your expression isn't so &lt;/SPAN&gt;convoluted&lt;SPAN style="line-height: 19.5px; font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Year(Month) - 1) * 12 + Num(Month(Month)) in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might want to consider looking into creating a master calendar as well, unless every date is covered in your XLS file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe you need to use the max( function in order to retrieve the last month based on the selection.&amp;nbsp; Think about it from the user perspective -- if they select 2012 and your set mod is month=month -- how does qlikview know what to default to?&amp;nbsp; max() gives you the max value based on what is selected (as long as you use the $ identifier).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 22:43:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-over-Month-w-Variable-in-Set-Expression/m-p/811162#M1043106</guid>
      <dc:creator />
      <dc:date>2014-11-24T22:43:14Z</dc:date>
    </item>
  </channel>
</rss>

