<?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 SV:Re: AW:Re: Value in between two variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212020#M502972</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To solve the "year-problem" I would probably do something like&lt;/P&gt;&lt;P&gt;MonthStart(Orderdatum) As OrderMonth&lt;/P&gt;&lt;P&gt;This maps all dates in september 2010 to 2010-09-01, etc (the first day in the month)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you should use the addmonths() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also add a variable in the load script:&lt;/P&gt;&lt;P&gt;Let vCurrentMonth = MonthStart(today());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final set expression using the created variable, would be something like this:&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Omzet.OrderMonth= {"&amp;gt;=$(=AddMonths('$(vCurrentMonth)', -6) &amp;lt;=$(=AddMonths('$(vCurrentMonth)', -1)"}&amp;gt; Omzet.Netto_orderbedrag)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Sep 2010 10:41:24 GMT</pubDate>
    <dc:creator>gandalfgray</dc:creator>
    <dc:date>2010-09-22T10:41:24Z</dc:date>
    <item>
      <title>Value in between two variables</title>
      <link>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212011#M502963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to figure out how to work with variables, and I came to this formule which works:&lt;/P&gt;&lt;P style="font-style: italic; padding-left: 30px"&gt;Sum({$&amp;lt;Omzet.Month={$(=Month(Today(2))-1)}&amp;gt;} Omzet.Netto_orderbedrag)&lt;/P&gt;&lt;P&gt;It returns the sum of the "Omzet.Netto_orderbedrag" from the previous month (Month(Today(2))-1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I now want is is a formule which returns the "Omzet.Netto_orderbedrag" from several months, for example the 5 months before the previous month. So somewhere in the formule it must have something like this : &lt;I&gt;&amp;gt;=(Month(Today(2))-6) &amp;gt;(Month(Today(2))-1)&lt;/I&gt;&lt;BR /&gt;But I don't get it to work, don't know which quote and breaks where to use.&lt;/P&gt;&lt;P&gt;I am sure you experts know how to do this! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 14:33:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212011#M502963</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-09-21T14:33:33Z</dc:date>
    </item>
    <item>
      <title>Value in between two variables</title>
      <link>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212012#M502964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;=SUM( {$&amp;lt; Month= {"&amp;gt;=$(&lt;I&gt;Month(Today(2))-6&lt;/I&gt;)&amp;lt;=$(&lt;I&gt;Month(Today(2))-1&lt;/I&gt;)"}&amp;gt; } Omzet.Netto_orderbedrag)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 14:46:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212012#M502964</guid>
      <dc:creator />
      <dc:date>2010-09-21T14:46:47Z</dc:date>
    </item>
    <item>
      <title>AW:Value in between two variables</title>
      <link>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212013#M502965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dennisnet,&lt;/P&gt;&lt;P&gt;I haven't tested it but I'm pretty shur that this mus work:&lt;/P&gt;&lt;P style="font-style: italic"&gt;Sum({$&amp;lt;Omzet.Month={&amp;gt;="$(=Month(Today(2))-1)"}&amp;gt;} Omzet.Netto_orderbedrag)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;Have Fun&lt;/P&gt;&lt;P style="font-style: italic"&gt;Alex:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: italic"&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 14:50:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212013#M502965</guid>
      <dc:creator />
      <dc:date>2010-09-21T14:50:00Z</dc:date>
    </item>
    <item>
      <title>AW:Value in between two variables</title>
      <link>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212014#M502966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, the &amp;gt;= has to be placed in the quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;&lt;I&gt;Sum({$&amp;lt;Omzet.Month={"&lt;/I&gt;&lt;I&gt;&amp;gt;=&lt;/I&gt;&lt;I&gt;$(=Month(Today(2))-1)"}&amp;gt;} Omzet.Netto_orderbedrag)&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt; &lt;I&gt;&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Sep 2010 15:06:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212014#M502966</guid>
      <dc:creator />
      <dc:date>2010-09-21T15:06:26Z</dc:date>
    </item>
    <item>
      <title>Value in between two variables</title>
      <link>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212015#M502967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Érico.&lt;/P&gt;&lt;P&gt;Yes I thought so too, it must be someting like that, but this returns the complete Sum of [Omzet.Netto_orderbedrag] so it looks like it ignores everything between the { } .......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 07:38:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212015#M502967</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-09-22T07:38:41Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Value in between two variables</title>
      <link>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212016#M502968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;another Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;=SUM( {$&amp;lt; Month= {"&amp;gt;=$(=&lt;I&gt;Month(Today(2))-6&lt;/I&gt;)&amp;lt;=$(=&lt;I&gt;Month(Today(2))-1&lt;/I&gt;)"}&amp;gt; } Omzet.Netto_orderbedrag)&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I think you need the "$(="&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have Fun&lt;/P&gt;&lt;P&gt;Alex:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 09:31:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212016#M502968</guid>
      <dc:creator />
      <dc:date>2010-09-22T09:31:46Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Value in between two variables</title>
      <link>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212017#M502969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Alexander,&lt;/P&gt;&lt;P&gt;I think your suggestion is right, but I think there must something wrong in my loading script which creates a different format.&lt;/P&gt;&lt;P&gt;Because I did some test and these where the results:&lt;/P&gt;&lt;P&gt;[Month] -- &amp;gt; sep //database field returns 3 caracters&lt;/P&gt;&lt;P&gt;Month(today) -- &amp;gt; sep //returns 3 caracters&lt;/P&gt;&lt;P&gt;Month(today)+1 -- &amp;gt; 10 //returns numbers (month number)&lt;/P&gt;&lt;P&gt;[Month]+1 -- &amp;gt; 10 //returns numbers (month number)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think it is possible to calculate with these different formats right?&lt;/P&gt;&lt;P&gt;In my script I creat [Month] like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Orderdatum,&lt;BR /&gt;&lt;/I&gt; &lt;I&gt;Month(Orderdatum) As Month ,&lt;/I&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Should I do it different?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 10:12:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212017#M502969</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-09-22T10:12:32Z</dc:date>
    </item>
    <item>
      <title>SV:Value in between two variables</title>
      <link>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212018#M502970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dennisnet&lt;/P&gt;&lt;P&gt;The general problem to specify an interval using set syntax can be solved in this way:&lt;/P&gt;&lt;P&gt;&amp;lt;Field = {"&amp;gt;=$(=vStart) &amp;lt;=$(=vStop)"}&amp;gt;&lt;/P&gt;&lt;P&gt;This specifies that Field should be larger than or equal to vStart and less then or equal to vStop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case it would be&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Omzet.Month= {"&amp;gt;=$(=Month(today(2))-6) &amp;lt;=$(=Month(today(2))-1)"}&amp;gt; Omzet.Netto_orderbedrag)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A sidenote: I think you may have to rework your formula because calculating with Month() as you do will get you into trouble when the months involved are in different years.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 10:18:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212018#M502970</guid>
      <dc:creator>gandalfgray</dc:creator>
      <dc:date>2010-09-22T10:18:43Z</dc:date>
    </item>
    <item>
      <title>SV:Value in between two variables</title>
      <link>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212019#M502971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that works! Thanks Göran.&lt;/P&gt;&lt;P&gt;And you are right about the different years, I am going to think this one over.&lt;/P&gt;&lt;P&gt;But now at least I have a formula that works, so I can work from there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lots of Thanks to all of you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 10:30:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212019#M502971</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-09-22T10:30:39Z</dc:date>
    </item>
    <item>
      <title>SV:Re: AW:Re: Value in between two variables</title>
      <link>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212020#M502972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To solve the "year-problem" I would probably do something like&lt;/P&gt;&lt;P&gt;MonthStart(Orderdatum) As OrderMonth&lt;/P&gt;&lt;P&gt;This maps all dates in september 2010 to 2010-09-01, etc (the first day in the month)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you should use the addmonths() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also add a variable in the load script:&lt;/P&gt;&lt;P&gt;Let vCurrentMonth = MonthStart(today());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final set expression using the created variable, would be something like this:&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Omzet.OrderMonth= {"&amp;gt;=$(=AddMonths('$(vCurrentMonth)', -6) &amp;lt;=$(=AddMonths('$(vCurrentMonth)', -1)"}&amp;gt; Omzet.Netto_orderbedrag)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 10:41:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212020#M502972</guid>
      <dc:creator>gandalfgray</dc:creator>
      <dc:date>2010-09-22T10:41:24Z</dc:date>
    </item>
    <item>
      <title>AW:Re: SV:Value in between two variables</title>
      <link>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212021#M502973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was the qualification of the month field. omzet.month instead of month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have Fun Alex:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 10:46:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Value-in-between-two-variables/m-p/212021#M502973</guid>
      <dc:creator />
      <dc:date>2010-09-22T10:46:53Z</dc:date>
    </item>
  </channel>
</rss>

