<?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 Average calculation – should calculated by dynamic Date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365786#M136086</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Hello all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;I have an expression that calculate the average&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;The dimension is selected from a variable &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;I like the average to be calculated taking the previous 7 days that was selected in the variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;My current average calculation is this :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff8000; font-size: 9.0pt; font-family: 'Courier New'; text-decoration: underline;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;price&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;='3.0', (r&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;ev&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;*&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;c&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)))/&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;price&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;='3.0',(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;))),&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;c_date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;price&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;c_hour&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)))*(&lt;/SPAN&gt;&lt;STRONG style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;EM&gt;Vcb_3&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #ff8000; font-size: 9.0pt; font-family: 'Courier New'; text-decoration: underline;"&gt;&lt;STRONG&gt;) &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;So I guess I need to take “&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;c_date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;price&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;c_hour&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;”&lt;/SPAN&gt; &lt;SPAN style="font-size: 12.0pt;"&gt;and make them dynamic somehow.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Appreciate your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Tomer&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 24 Jun 2012 15:45:56 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-06-24T15:45:56Z</dc:date>
    <item>
      <title>Average calculation – should calculated by dynamic Date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365786#M136086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Hello all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;I have an expression that calculate the average&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;The dimension is selected from a variable &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;I like the average to be calculated taking the previous 7 days that was selected in the variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;My current average calculation is this :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff8000; font-size: 9.0pt; font-family: 'Courier New'; text-decoration: underline;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;price&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;='3.0', (r&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;ev&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;*&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;c&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)))/&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;price&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;='3.0',(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;))),&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;c_date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;price&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;c_hour&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)))*(&lt;/SPAN&gt;&lt;STRONG style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;&lt;EM&gt;Vcb_3&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #ff8000; font-size: 9.0pt; font-family: 'Courier New'; text-decoration: underline;"&gt;&lt;STRONG&gt;) &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;So I guess I need to take “&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;c_date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;price&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;c_hour&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;”&lt;/SPAN&gt; &lt;SPAN style="font-size: 12.0pt;"&gt;and make them dynamic somehow.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Appreciate your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Tomer&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jun 2012 15:45:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365786#M136086</guid>
      <dc:creator />
      <dc:date>2012-06-24T15:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation – should calculated by dynamic Date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365787#M136087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tomer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not sure if I've understood. You are using this expression in a chart object, and your (only?) dimension is set using a variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be good if you could post a full definition of your dimensions (i.e. the variable) and expression (e.g. how Vcb_3 is defined). It would probably most easy if you could post a small sample app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to limit your expression to a certain date range (and this range might be defined by a selected date -7 days or variables), you could use set expressions with your aggregation functions, something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sum({&amp;lt;Date = {"&amp;gt;=$(vDate)-7&amp;lt;=$(vDate)"}&amp;gt;} if(price='3.0', (rev*c)))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(this is just an example, please look into set analysis in the HELP)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Jun 2012 16:36:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365787#M136087</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-06-24T16:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation – should calculated by dynamic Date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365788#M136088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Yes it seems like “Set analysis” is what I’m looking for.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Thanks for that tip.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;My dimension is a simple “DateFormat” that is taken from the user input.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Before making things complicated I I try to start with the basic:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;When I try this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 12.0pt;"&gt;sum({$&amp;lt;c_date =&amp;nbsp; {'2012-06-22'} &amp;gt;} sales)&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;this one is working and ok, I’m happy with that&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;no I move to variable….&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 12.0pt;"&gt;sum({$&amp;lt;c_date =&amp;nbsp; {$('Vreference_Date') } &amp;gt; } sales) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;my “Vreference_Date'” holds the same value as I added manually above (2012-06-22)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;I try to remove the single quote, but the calculation ends up with ‘-‘ while with the single quote I got 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;If I change the c_date to a different dimension, like price and my formula look like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 12.0pt;"&gt;sum({$&amp;lt;c_price =&amp;nbsp; {$(Vreference_Date) } &amp;gt; } sales) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;then I got the right and my expected output, for the specific variable (price point) that I put.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Tomer&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 06:14:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365788#M136088</guid>
      <dc:creator />
      <dc:date>2012-06-25T06:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation – should calculated by dynamic Date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365789#M136089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;My single quotes location were misplaced,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Once that was fix I manage to get the result I’m looking for&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;The formula output looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;c_date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; =&amp;nbsp; {'$(Vreference_Date)'} &amp;gt; } &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;sales&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;and I got the result of the selected date I put in the variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Now I need to take not only the date in the variable also to take the 7 days before and sum them all together.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Ideas?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Tomer&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 07:56:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365789#M136089</guid>
      <dc:creator />
      <dc:date>2012-06-25T07:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation – should calculated by dynamic Date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365790#M136090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using Dates in set analysis might get a bit tricky, it's not such easy to get the formats right the first time.&lt;/P&gt;&lt;P&gt;It is recommended that you are using numerical variables for the dates in set analysis, so if your variable definition now looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=today()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=num(today())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[As you probably know, dates have a textual and numerical representation]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having numerical date variables, I think your set expression should be very similar to the one I posted above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sum({&amp;lt;c_date = {"&amp;gt;=($(vNumRefDate)-7)&amp;lt;=$(vNumRefDate)"}&amp;gt;} sales)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 08:24:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365790#M136090</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-06-25T08:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation – should calculated by dynamic Date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365791#M136091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Yes this is helpful but I still have a problem limiting the selection&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;I have this now:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;sum({&amp;lt;c_date = {'&amp;gt;=2012-06-22-7 &amp;lt;2012-06-22'}&amp;gt;}sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;what actually is happening is that it sums all dates below 22nd &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;I need to limit it for the last 7 days and not the entire dates that I have. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 08:56:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365791#M136091</guid>
      <dc:creator />
      <dc:date>2012-06-25T08:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation – should calculated by dynamic Date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365792#M136092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you post a small example app we can easily take a look.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your problem is that this code won't work:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px; background-color: #eef4f9;"&gt;sum({&amp;lt;c_date = {'&amp;gt;=2012-06-22-7 &amp;lt;2012-06-22'}&amp;gt;}sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12px; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px; background-color: #eef4f9;"&gt;Swuehls code should do the trick; I can hardly add to his previous post: the date must &lt;STRONG&gt;FIRST&lt;/STRONG&gt; be converted to numerical (so your 22-6-2012 will be a number like 41085 or something similar) and from that number you can extract the 7 days...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New'; font-size: 12px; background-color: #eef4f9;"&gt;Roberto&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 09:12:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365792#M136092</guid>
      <dc:creator />
      <dc:date>2012-06-25T09:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation – should calculated by dynamic Date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365793#M136093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your dates are not using the numerical representation I suggested.&lt;/P&gt;&lt;P&gt;For example 2012-06-22 has a numerical representation of 41082&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the problem is that 2012-06-22-7 won't be interpreted as date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also try to create a second variable for your lower limit and subtract the 7 days in the variable definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. For an advanced search in the set modifier, I would personally use double quotes instead of the single quotes. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 09:18:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365793#M136093</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-06-25T09:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Average calculation – should calculated by dynamic Date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365794#M136094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Thanks a lot for all your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;At the end is did the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Once a specific date is put, I will calculate into different variables the MAX and MIN dates for calculation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;This will do the trick to me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Appreciating all your help and support.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Tomer&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jun 2012 09:46:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-calculation-should-calculated-by-dynamic-Date/m-p/365794#M136094</guid>
      <dc:creator />
      <dc:date>2012-06-25T09:46:52Z</dc:date>
    </item>
  </channel>
</rss>

